3 ms·
Some time ago I wrote my thoughts in a blog post: https://idea.popcount.org/2013-09-05-it-aint-about-the-callbacks/ https://idea.popcount.org/2013-09-05-it-ain
by majke 12y ago
Some time ago I wrote my thoughts in a blog post:
https://idea.popcount.org/2013-09-05-it-aint-about-the-callbacks/ https://idea.popcount.org/2013-09-05-it-aint-about-the-callb...
Basically, it's easy to show that callbacks are a much harder paradigm to work with considering flow control.
That's it. There is a place to use callbacks, but if you need anything that is not trivial and won't blow up at some point, you should use threads. Greenlets, processes or whatever you call it, things with stack that take time to context switch.
I strongly believe threads are better, if not anything else is due to the fact that when you do "spawn", you make an explicit statement, saying: here we demultiplex - programmer beware of flow control here!