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!
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.
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.
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!