3 ms·
yea same here. I wrote nodejs programs for years. the focus on the eventloop and everything being asynchronous is great for servers and network IO but does NOT
by cultofmetatron 3y ago
yea same here. I wrote nodejs programs for years. the focus on the eventloop and everything being asynchronous is great for servers and network IO but does NOT make it the perfect choice for scripts. Its a different use case entirely.
scripts are supposed to be small simple programs that run in sequence and terminate. I shouldn't need to deal with concurrency primitives at all in that particular situation.
- colordrops 3y agoWith modern JavaScript (as in last 5-7 years) it's pretty straightforward to write sequential scripts.
- petre 3y agoThere's more to it than writing a simple sequential python, ruby or perl script. You have to write everything using async/await.
- colordrops 3y agoasync/await are dead simple. And many Node libs have synchronous versions. It's pretty straightforward if you are familiar with the language. If you aren't, well that isn't really the fault of JS nor any different from bash or python, which can both be just as painful for those unfamiliar.
- anonymous_sorry 3y ago> scripts are supposed to be small simple programs that run in sequence and terminate. I shouldn't need to deal with concurrency primitives at all in that particular situation. I suppose bash pipes are a concurrency primitive, but I don't object to them. I think it's more about appropriate primitives.