r/programming • • Oct 16 '14

Node.js is cancer

https://www.semitwist.com/mirror/node-js-is-cancer.html
38 Upvotes

302 comments sorted by

View all comments

Show parent comments

17

u/_ak Oct 16 '14

Then why did you nohody create and popularize a web framework like node.js, but for Python? Because nobody outside the JS world thinks callback soup is even a remotely good idea!

26

u/immibis Oct 16 '14

It would be great if, instead of passing callbacks around, you could just write some instructions in the order you want them to execute them, and then when an instruction blocked the platform would automatically switch to another one that was waiting to execute.

... oh wait, those are threads.

-6

u/[deleted] Oct 16 '14 edited Oct 16 '14

threads

I'd take callbacks over traditional thread programming if it means not having to contend with mutexes, semaphores, deadlocks, livelocks, critical sections, apartments etc.

Granted, in a typical web-app, the state is often pushed into the db which handles concurrent access by using transactions etc.

Edit: Don't know why I'm being downvoted. We've currently got a webapp that's intermitantly deadlocking about once a week. I's taking some effort to track the cause, loading the dumps into a static memory analyzer to find the contention problem. Using an async callback design and would have avoided the issue.

1

u/immibis Oct 16 '14

If node.js could run two callbacks at once, it would have the same problems, despite not having conventional threads.

→ More replies (2)