Re:Callbacks as our Generation's Goto Statement
by captaincrowbar on Thursday August 15, 2013 @07:58PM
(#6221379)
If you're doing everything sequentially anyway, why bother with the awaiting part? As far as I can see your example would be functionally unchanged if you wrote the same code except without the await keyword.
[ Parent
| on HN ]
Re:Callbacks as our Generation's Goto Statement
by scott_s on Thursday August 15, 2013 @10:59PM
(#6221964)
Because it doesn't block the thread. The idea is that this code is executed inside of a thread that, if it blocks, will cause the application to hang. For example, in a GUI or a server. So, if its a thread driving a GUI, and it's blocked on user input, then the entire application interface will be unresponsive until it receives that input.
Re:Callbacks as our Generation's Goto Statement
by danabramov on Friday August 16, 2013 @05:00AM
(#6222907)
This. Specifically, I'm thinking about iOS prompts and alerts, they are not blocking.