Can someone who uses it happily on the backend talk about why they like it and why it's good?
Can someone who uses it happily on the backend talk about why they like it and why it's good?
* 10-day design? Nobody is using Javascript 1.0 anymore.
* Typing is available to various extents thanks to Flow and/or Typescript.
* Slowness... I don't know what you're referring to. Javascript isn't slow.
* null vs undefined. What about them? They are two different things with different meanings.
* Dependency hell. I assume you refer to the many small modules on NPM with dependencies on other modules. Not sure what the problem here is per se. Avoid them if you don't like dependencies.
* NPM insecurity - what?
I like JS on the backend because it's a nice, flexible language to work with, with a healthy and cheap (cost-wise) ecosystem. I get a lot of stuff done very quickly, and I can run my stuff pretty much everywhere.
NPM packages can contain malicious code. There's no NPM review process, and you can't point to specific versions to lock in your own reviews (package administrators can change whatever files they'd like). There's no such thing as a verified-safe dependencies list because the file you reviewed last month might not be downloaded today.
Yes you can.
>no such thing as a verified-safe dependencies list
There are audits.
That being said, most package managers can contain malicious code and very few of them actually review their packages.
Besides, any company using NPM seriously probably has their own proxy in front of it, so there's no case of "the file might not be downloadable anymore" if that was already a problem with NPM itself.
Slowness: Yes, it is. Look at all the benchmarks comparing it to, say, go.
One of JavaScript's big advantages over Ruby and Python was performance, both because the standard runtime is faster (JITing JavaScript turned out to be a lot easier than JITing Ruby and Python) and because its fundamentally asynchronous nature was a better match for webservers.
And although NPM sucks in a number of ways, I've always found it easier to use than Python's dependency management.
Why was this the case?
The other advantage JavaScript had was that there were large, well-funded organizations (notably Google and Mozilla) competing on performance. Python and Ruby were always community projects and they had a strong emphasis on maintaining backwards compatibility with a large and diverse ecosystem, and there wasn't a lot of demand for faster implementations.
Ruby and Python are the opposite of that. Ruby and Python are I'd say literally a thousand times more complicated to compile than JavaScript.
Using JS in the backend means that you don't have to learn a new language if you're already familiar with it in the browser. Given that webdev is extremely popular with new developers these days, it's not surprising that they might want to reuse the technology when they have to write backend code instead of learning a whole new language. Similarly companies can reuse their pools of webdevs to write non-web applications instead of hiring new personnel or having to retrain the existing coders.
It also means that you can reuse code from the browser in the backend.
Sure if you find JS a clunky and subpar language it might be disappointing to see it spread the way it does but hey, at least it's not PHP!
The async model is easy to use so you get good performance before even optimize it. It comes out of the box with good json serialization/parsing, so that’s one less dependency. Not really sure where you’re coming from.