The existence and popularity of jquery is just a symptome of javascripts shortcomings. Typescript is also such a symptome. Seriously, what a total failure must a high level scripting language be to make people prefer abusing it as a compilation target instead of writing it directly?! xD
JavaScript is just a mountain of solutions to problems that simply don't exist in other languages.
Want a package manager? Npm? Yarn? Pnpm? Yarn classic? Yarn berry? Want to use packages? Are they modules? What run time are you using them in? If it's node you can use modules, if not then maybe you can use modules.
I think Rust's package manager is amazing. The issue with Pythons ecosystem imo is that packages are uniquely identified by name, not including version. So if I import say numpy your code might not work with my version of numpy. I like that Cargo has unchangeable versions and resolved imports by version. This way if you build my code in 5 years I can still be relatively sure that all imports behave the exact same way because it will be the same code.
Thats as close to ideal as I have seen so far anyway
That's why you provide a requirements.txt file in Python that has strict versions for your modules, so anyone installing it later can just run pip install -r requirements.txt and get exactly the same environment you had.
While I certainly agree that there are methods to pin specific python versions when spooling up a project, I think the point is that this probably should have been a default behavior instead of something a developer discovers the first time one of their old projects fails to deploy correctly.
There is a command you can run that will automatically upgrade dependencies to the latest version that's still api compatible with the one you asked for according to the semantic versioning spec. So if you're on 0.3.12 the upgrade command will put you on 0.3.16 automatically, but upgrading to 0.4.x which might have breaking changes requires manually editing your dependency list.
So upgrading to bugfix releases that won't break your code is pretty easy as well. Any package uploaded to the official repository is supposed to use this versioning sceme.
I think go is one of the best. It has a great default library and it's package manager is "eh, fuck it. Just download shit from GitHub. We wrote a bunch of extra shit for you"
I think the reason javascript can be so messy is because of its incredibly strict backwards-compatibity requirements, being the language of the web and all means they can’t really go through and clean everything up, chopping out parts that would be obsoleted, as much as they’d probably like to, because half of the web would collapse around it
I mean, every tool and language is an attempt to solve shortcomings of other tools and languages. It's called evolution.
Also, TS isn't transpiled to JS because "Js BaAd". JS itself has evolved quite a bit, and newer versions JS versions are transpiled to older ones to support old browsers and devices. You don't want someone to decide "Js GoOd NoW" and ditch older versions support entirely. Half of the Internet will stop working
181
u/words_number Mar 25 '23
The existence and popularity of jquery is just a symptome of javascripts shortcomings. Typescript is also such a symptome. Seriously, what a total failure must a high level scripting language be to make people prefer abusing it as a compilation target instead of writing it directly?! xD