Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So many comments here critical of nonblocking code. What, exactly, is the downside? Seems to me that any downside is purely syntactical (callback hell etc. or whatever people like to say when they can't write good nonblocking code).

So with nonblocking code you have the challenge of a syntax that may be difficult for some. With any variant of threading, you have the actual real programming challenge of dealing with state, locking etc. I would much rather have syntax issues than state issues.

Also the only people who complain about nonblocking code are those who have been writing threads for 15 years. Why is it that something that is supposedly so bad and confusing is actually so easy for new programmers to pick up?



I find myself wondering the same thing. async-await syntaxes make asynchronous functions work pretty much the same as synchronous ones syntactically. The only drawback I can really think of is that you end up Futures going up the call stack. But this, again, seems to me to just be a detail.

On the other hand, the benefits are really obvious control flow with implicit synchronization. Scala has shown that it's pretty easy to integrate asynchronous workflows with actors.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: