Hacker News new | past | comments | ask | show | jobs | submit login

OK, we can't do threaded imperative programming because threads are expensive and people botch the locking. So we have callbacks where completion of some external event calls you back. Then you need closures so the callback has some state so it knows what to do when called back. Now you have a control structure problem, and need a state machine to decide what to do next. But most of the time you just want to do the next thing, so there's syntax such as ".then()" so you can write imperative programs again.



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

Search: