• sbv@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    52
    arrow-down
    1
    ·
    12 days ago

    I love shitting on Python, but I feel like all those problems are present in libraries for other languages as well. There’s a tonne of that crap for JS/TS.

    Similarly, I find a fair number of Rust crates (that I want to use) have virtually no doc or inline examples, and use weird metaprogramming that I can’t wrap my head around.

    • The Bard in Green@lemmy.starlightkel.xyz
      link
      fedilink
      English
      arrow-up
      48
      ·
      12 days ago

      Are we living in a world in which the JS/TS ecosystem is the yardstick by which we measure well written code? I mean… Wait a minute! I figured it out! This is the Bad Place!

    • Pacmanlives@lemmy.world
      link
      fedilink
      arrow-up
      9
      ·
      12 days ago

      You should look at some old Perl or C code. I have even seen some shell code that makes me want to bash my head in till death with an IBM Model M Keyboard

    • leisesprecher@feddit.org
      link
      fedilink
      arrow-up
      4
      ·
      11 days ago

      I feel like there’s a very fine balance for the effort required to publish a package.

      Too easy and you get npm.

      Too hard and you get an empty repo.

      I feel like Java is actually doing a relatively good job here. Most packages are at least documented a bit, though obviously many are outdated.

      • expr@programming.dev
        link
        fedilink
        arrow-up
        3
        arrow-down
        1
        ·
        11 days ago

        Uh, there are an absolute fuckload of Java libs out there with nothing more than auto-generated garbage Javadocs.

  • sus@programming.devOP
    link
    fedilink
    arrow-up
    35
    ·
    12 days ago

    bonus points if you’re using a statically typed language but the library uses extensive metaprogramming seemingly for the sole purpose of hiding what types you actually need

  • JackbyDev@programming.dev
    link
    fedilink
    English
    arrow-up
    11
    ·
    11 days ago

    This is probably my biggest complaint about trying to learn Python past the beginner level and into intermediate and beyond. This is also one of my strongest arguments in favor of static type systems over dynamic ones.

  • dudinax@programming.dev
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    12 days ago

    Rust crates have the second and third problems.

    Rust at least has type annotation.

    The type has private fields. There’s no constructor. There’s no implementation of the From trait except on itself. You can’t find a function anywhere that returns the type.

  • Evil_Shrubbery@lemm.ee
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    11 days ago

    Using cryptic parameter names is just nonsense when you can obviously use lewd cryptic parameter names instead.

  • AVincentInSpace@pawb.social
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    2
    ·
    12 days ago

    you should learn Rust. the type system is so comprehensive that half the time you can guess what a function does (or at the very least what you’re supposed to pass to it) without a single line of human written documentation.

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    11 days ago

    And now we have free threads so I can’t say at least you don’t have normal concurrency problems 🤣

  • kaffiene@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    10 days ago

    I really like Python. The only thing I don’t want to do with Python is support a large code base. Lack of strict typing makes refactoring awful

  • Reptorian@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    9 days ago

    I’m just glad I have other options than just Python. Am not afraid of writing my solutions either. I rarely use Python these day.