3 ms·
I feel like Node being "async-first" is such an underrated feature, compared to its big competitors (Python, Ruby, Perl). I really don't some of the Javascript
by nerdponx 6y ago
I feel like Node being "async-first" is such an underrated feature, compared to its big competitors (Python, Ruby, Perl). I really don't some of the Javascript quirks, but Node is a great general-purpose scripting tool as a change of pace from Python.
Edit: I know we're not supposed to talk about voting on HN, but really? -2 for saying "hey maybe NodeJS is actually kind of OK for some stuff" is wild.
- VWWHFSfQ 6y agoI don't think "async-first" is really all it's cracked up to be. It's great for concurrent I/O (webservers). Not great for writing run-of-the-mill sysadmin scripts like rotating log files, doing file backups, etc. Now instead of just knowing that your cron job is doing something one at a time, suddenly you have all these async things happening and you look at your process table and there's 40 node.js processes trying to compress every log file in the system all at once. And if you don't want it to do that then you have to start managing the concurrency yourself. I've never had to manage concurrency in a shell script beyond just making sure my crons don't run over each other if they take too long.
- nwienert 6y agoYou’re conflating concurrency and parallelism. Unless you’re explicitly forking the process, the async all happens in one process. Async is incredibly easy to manage in node, even the simplest linter handles telling you you’re forgetting to await if you are.
- colordrops 6y agoYou can do it all synchronously in node if you wish. The async gives another dimension to work with.
- hamburglar 6y agoExcept the first two commands I looked at the implementation for were implemented as sync IO calls (and one of them was “cat” which is implemented as a sync read of the entire file).
- canadianfella 6y agoYou’re missing a word. Try fixing that.