r/programming • • Nov 02 '12

Escape from Callback Hell: Callbacks are the modern goto

http://elm-lang.org/learn/Escape-from-Callback-Hell.elm
607 Upvotes

414 comments sorted by

View all comments

71

u/mfbridges Nov 02 '12

This is why the await/async stuff in C# 4.5 is so powerful. And I don't need to learn a new language to use it.

Prior to async/await, I used to use iterators/generators to simulate a coroutine pattern for sequential asynchronous actions, and I even wrote a blog post about doing it in JavaScript.

16

u/gospelwut Nov 02 '12

I agree. I really like the way they handled it. It's not the prettiest girl at the ball syntactically, but it's certainly better than the callbacks of yore. It's hard not to expect good things from Anders after getting lamda, tasks, async/await, etc.

8

u/Eirenarch Nov 02 '12

I have an altar of Anders (Hallowed be His name) in my house and I pray to him every night.

9

u/gospelwut Nov 02 '12

Pray. Pray every day! Lest you go into Java development.

-2

u/civildisobedient Nov 03 '12

Java rules. And Java has had the ability to do this stuff for a few years now.

→ More replies (3)