7
BlackCenti
338d

Y'all can bash me for it, but Python is one language that ought to be banned along with Javascript...

Amount of times that it breaks or have incomplete implementation is absurd. I just had to deal with idiotic developer who just love to break backward compatibility (looking at you numpy), by changing the type or function name by literally one letter which break older software written in Python that were still in use. (They never specify version for dependencies.) The best part is when they intentionally delete older dependency anyway even if the version is specified.

There's a reason why I do things in C language rather than any other languages, one of the big thing about it is that almost every libraries/code have kept backward compatibility in mind.

Comments
  • 8
    That's more a rant against lib dev than against the language in itself.
  • 0
    @Jabb03 Maybe, but python have a systemic ecosystem problem that this is happening like 99% of the times. The only literal exception is probably Meson Build and that because they intentionally avoid all dependencies and rewrite things manually in their own code.
  • 2
    My ftp downloader and removing remote files after the download is working fine and made with python. Still running everyday fully automated.
  • 2
    I like JavaScript, it gives me an incredible freedom in programming. The whole library shebang doesn't really apply to me personally, I usually write most stuff myself specific to my use case, so no need for absurd amounts of libraries.
  • 2
    @Ranchonyx True. To be fair, most new tech like vue or react/angular are far worse with all the packages they need.

    Most libraries in python that I have seen are well documented.
  • 3
    Yes this is a problem with lib devs and not the language.
    However, with a sane language, the break in backward compatibility will be noticed at compile time and can be addressed to fix it, while with a clown language, it will be only noticed too late when something doesn’t work at runtime or not noticed at all.
  • 2
    Stop depending on numpy/scipy.
    Yes - it is that simple.

    Also - use a linter, and a properly maintiained locked requirments file.

    Or - reimplement everything in C/C++. Your call.
  • 2
    By this criteria then boost is total shit too. I had something based upon an older version of boost in C++. I tried compiling against a newer version and all sorts of stuff was broken. C++ is total shit!

    Or, people track their library versions and keep the projects isolated. Python even provides tools to completely containerize the project so you can mix versions of the same library on the same system.
  • 4
    @magicMirror C/C++ is not the only choice. There are languages that combine the convenience and speed of development of JS/Python with the performance and strictness of C++, with little to none compromises and safety as a bonus.
    You don’t have to choose between different kinds of bad.
  • 0
    So much better to manage system level libraries without a standardized package manager!
  • 1
    @Lensflare
    Yes! Reimplement in Assembler! /s
  • 2
    @magicMirror h-how about... Rust

    Though I'm not sure speed of development applies, I haven't done a lot with it (meaning I have barely read the tutorial book)

    But convenience with a sane, standard package manager does apply, I think
  • 0
    Rust! letssss goooooo! /S

    Or just wrap the orginal Python thing in a docker container? Yes? No?
    ...
    No.
    ....
    Golang! std lib is great! has GC! Actual threads instead of GIL! Slower then Rust!
  • 1
    I don't get how this is a language problem if your "faulty" lib was installed through pip. Pip does support libraries publishing minimum *and* maximum versions for their dependencies.

    Likely your lib didn't bother to specify, or is unmaintained and left it open ended without testing.
  • 0
    @Jabb03

    my_var = ("foo", "bar") # my_var[0] == "foo"

    my_var = ("foo" "bar") # my_var[0] == "f"

    my_var = ["foo" "bar"] # my_var[0] == "foobar"

    No syntax error, no runtime error, just completely unintentional and inconsistent behaviour. I'll take JS over this kind of bullshit anytime.
  • 2
    @CoreFusionX @Jabb03 It's Python that forces libraries to be installed globally, which in turn encourages developers to only provide the bare minimum version locking (i.e. only specify the "major" version) for their libraries and dependencies. It's also Python that enforces versioning scheme which looks like semantic versioning but doesn't reflect any kind of actual code changes, which is why many popular libraries have been on the same "major" version for over a decade while still deprecating and removing / changing APIs all the time. It's Python that doesn't provide a good dependency resolution algorithm where one could at least restrict incompatible transitive dependencies to some compatible version. It's Python that promotes shitty hacks like virtual environments instead of providing a consistent "official" solution.

    Numpy didn't break anything out of their established release flow. Python dependency management made it into a problem by not providing adequate control to the user
  • 0
    I usually roll my own library functions in Python for this reason and more. It often winds up being faster, but aside from anything security-related, rolling your own means 1) it's not gonna change out from under you,
    2) you can tailor it to the rest of the code, leading to much faster execution.
    3) learning is fun.

    As for giant overhaul modules like numpy, these tend to break or override some parts of the built-in modules, so I hate using them.
  • 1
    @Parzi

    Using python without numpy, if you have to do any kind of FLOPS, is suicide, though.
  • 0
    @CoreFusionX I've not had issues with that, actually. I've never really found a valid use for numpy after being frustrated with it mangling arrays in 2.x, because writing my own handlers for these things wind up being faster (and easier to use) 80% of the time.
Add Comment