News for hackers. Stuff that matters.
Re:Fogus: Node.js should become its own language by randylahey on Tuesday April 12, 2011 @12:41PM (#2437946)
I wish this was rated higher. I don't understand the fuss about "spaghetti code". Do all those people write spaghetti code in other languages? Because I see that not as a language failing but as sloppy programming.

What's so hard about this to get a sequential execution of functions/blocks, error'ing out on the first error:

    async.waterfall(
      [ function (callback) {
          // do thing 1
          callback();
        }
      , function (callback) {
          // do thing 2
          callback();
        }
      , function (callback) {
          // do thing 3
          callback();
        }
      ]
      , function (error) {
          if (error) {
            // ohnoes errors
          }

          // all done!
        }
      );

There are no comments on this comment yet.