4 ms·
Every Node-newbie should read and understand the chapter on Control Flows (http://book.mixu.net/ch7.html http://book.mixu.net/ch7.html), particularly the async
by hopeless 15y ago
Every Node-newbie should read and understand the chapter on Control Flows (http://book.mixu.net/ch7.html http://book.mixu.net/ch7.html), particularly the async for loop. This tripped me up with my little node app (http://urlpipe.com http://urlpipe.com) before I refactored it to use recursion (and then eliminated the problem by using Redis Pipelining).
But it still strikes me as one of those "think differently" parts of Node
- krmmalik 15y agoThanks for pointing this out. That chapter was a complete eye opener for me. When you're new to not just Node but programming itself - understanding the terms used is in itself a challenge. I'm writing my very first app and i chose to do it in Node. I started to suspect i was going to hit the problems described in this chapter very soon but i had no clue what terms to search or where to look. At least now i know what control flow actually means, and while i havent understood the examples completely at least its given me enough of a taster to start thinking about it.
- TrevorBurnham 15y agoMay I mention that I have an entire book on this subject coming out in March? http://leanpub.com/asyncjs/ http://leanpub.com/asyncjs/
- krmmalik 15y agoYes you may. Thanks. Could you please tell me at what level this book is aimed at? Experienced developers, average? Complete beginners?
- TrevorBurnham 15y agoIntermediate. It would work well as the second book you read on JavaScript (or, given the way most devs come to JavaScript, the book you read after reading a book on jQuery). But there's stuff in there that even experienced devs might not know about, like Promises and control flow libs like Async.js.