3 ms·
It's unfortunate that Node doesn't use actor based coroutines. Most of the code readability issues would go away.
by richcollins 15y ago
It's unfortunate that Node doesn't use actor based coroutines. Most of the code readability issues would go away.
- moe 15y agoCount me in. There's a die-hard core of callback proponents (especially in twisted- and lately in node-land) who claim the pure callback-style is more predictable, robust and testable. This is not my experience. I've been through that with twisted (heavily), some with EventMachine and some with node.js. The range of use-cases where I'd benefit from that style was extremely narrow. For most tasks it would turn into a tedium of keeping track of callbacks and errbacks, littering supposedly linear code-paths with a ridiculous number of branches, and constantly working against test-frameworks that well covered the easy 90% but then fell down on the interesting 10% (i.e. verifying the interaction between multiple requests or callback-paths). I'm sticking to coroutines where possible now (eventlet/concurrence) and remain baffled over the node-crew's resistance against adding meaningful abstractions to the core. I like javascript a lot (more so with coffee), but I see little benefit in dealing with the spaghetti when that doesn't even give me transparent multi-process or multi-machine scalability. And to prevent the obligatory: Yes, I know about Step, dnode and the likes. They remain kludges as long as the default style (i.e. the way all libraries and higher level frameworks are written) is callback-bolognese.
- richcollins 15y agoThe best implementation of concurrency that I've used: http://www.iolanguage.com/scm/io/docs/IoGuide.html#Concurrency http://www.iolanguage.com/scm/io/docs/IoGuide.html#Concurren...