I know that we all have our preferences of langauges, but is Javascript in 2022 actually any worse than anything else as a scripting language? What would you prefer instead?
That's of course purely anecdotal, but recently I explored static site generators.
One of these was Hugo(written in go, which is pretty young ecosystem, I'm not very familiar with). Everything was pretty straight forward.
Other one was Gatsby v4 (seems like pretty mature JS project). Oh boy.
Docs suggest multiple ways to initialize new project, depending which page you open and without clear explanation of the difference. NPM will download ungodly amount of dependencies and then inform you happily, that you have 16 critical vulnerabilities. Plugins tend to create dependency hell.
In general each time I try to do something with JS I end up debugging issues that require some arcane knowledge, filtering outdated docs and dealing with general flakiness of everything.
While I get, that on frontend it might be hard to avoid, I don't get why someone does it to themselves, when having other options (purely subjective opinion - I spend most time on backend, so I'm probably biased).
Fair enough. I do agree that JS-based libraries, frameworks, and tools tend to have bad docs and questionable API designs, compared to equivalents that I've used in other languages. There is some cultural issue there that I don't understand.
But... this is an embedded scripting environment! You aren't using any of that stuff.
Yes and no. You're definitely less exposed to JS ecosystem, but it's often the same issue with available examples, code snippets, docs.
I've similarly bad experience with for eg. plugins for VS Code. I wanted to add more supported syntax to org-mode plug in, at which point I found that their test suite is messed up.
Of course none of this is inherently fault of JS as a language, but current development culture around it promotes use of lots of silver tape, which makes me nervous, when I have to use anything JS-based.
It comes down to a combination of factors, but the long and short of things when it comes to content-focused sites specifically is that companies want all of:
- A modern user experience with rich content
- Authoring tools which are easy for non-technical users to understand
- Fast content delivery times
- Low operational costs
The problem is that getting all of them at once requires a bunch of fiddly integration problems. These problems are compounded if you throw e-commerce into the mix as well, in which case your marketing department is gonna want all kinds of analytics to try and suss out what users are doing, when, and why.
So, a lot of the weirdness and complexity has to do with making projects adaptable enough to handle a variety of different use cases while still offering at least a little bit of lift (vs. rolling the entire thing oneself).
Same, but then they lost me at Javascript.