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

Another upcoming method to avoid callback hell that is my personal favorite is harmony generators and yield. Reminds me so much of C# async. Two great libraries can handle it today on beta versions of node [1,2]. I have only used suspend. See this gist for comparison https://gist.github.com/codystebbins/a2c354d25ce28879bfe1.

With generators try/catch can be used, avoiding a lot of the redundant error handling. Crabdude's library can avoid the overhead of try/catch [3].

And if developers want static typing, they should check out TypeScript. Works great with node.

[1] https://github.com/jmar777/suspend [2] https://github.com/visionmedia/co [3] https://github.com/CrabDude/trycatch



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

Search: