I'm not trying to troll, so please hear me out. But has Javascript become so universally liked that it's the go-to tool for quick one-off scripts like this? Is it really much better or easier that you would choose it over, say Python or just a shell script? Or is it that Javascript happens to be the best tool for this particular job? I guess what I'm asking is, do most people reach for JS/Node over other languages fo…
I used to write scripts in python. I switched to node. Benefits for me. 1. Python by default requires tons of globally installed libraries. Node by default all libraries are installed local the the project. Nothing to learn. It just does it. That means I don't have to worry about trashing my system and I don't have to tell users a bunch of prerequisites to get it to work. 2. Node is ~8meg and installs instantly. Pyth…
Installing node is faster until you have to install local libraries. I am currently working on a project whose dependencies consist primarily of Vue, Bootstrap, and a few very small libraries such as moment.js. Our node_modules/ is over 1000 individual libraries and growing. It takes 45-65 seconds just to do an npm install when I already have the libraries there. The build process takes 90 seconds on a brand new top of the line machine. Contrast with Python where that number is 0, and installing the dozen dependencies I actually have is a one time process that takes no time at all.
I used to fuck around with Gentoo Linux where I would always triple compile the latest gcc to make sure I had the latest and greatest and fastest. And even I think Node’s library ecosystem is a bloated unnecessary mess. I don’t have the words to write a more scathing review of it, but if I could I would. There is a night and day difference in usability and speed between Node and Python ecosystems and the latter wins by such a wide margin it is like they aren’t even in the same league.
And don’t get me started on how quickly the JS community likes to break shit. Remember when for a brief moment we were all supposed to switch to yarn? And then migrate back to npm? It’s insane.