News for hackers. Stuff that matters.
Re:Ask HN: How do you deal with the NodeJS Pyramid of Doom? by hacknat on Thursday February 07, 2013 @07:54PM (#5185593)
Instead of using lambdas why not name your functions (function expression) and pass those around instead like so:

var someFunc1 = function(){...}

var somFunc2 = function(){...}

someNodeBinder1(someFunc1);

someNodeBinder2(someFunc2);

That being said, this is why it is best to avoid large projects with node.

Re:Ask HN: How do you deal with the NodeJS Pyramid of Doom? by tferris on Saturday February 09, 2013 @02:37AM (#5192017)
> That being said, this is why it is best to avoid large projects with node.

Like Airbnb, Linkedin and MySpace?? You can handle even large codebases well with Node. Callback hell is overrated since a large chunk of your code still stays synchronous for most server side rendered Node.js sites. At the end you implement user concurrency not in your app rather in some load balancing entity abstracting this away from you core app logic. Then, writing a Node app isn't much different than writing a Ruby or Python app (if using the right patterns/tools/libs).

And you get amazing speed: I think most didn't get how fast Node.js is -- it's factor 100 compared to any other traditional scripting language (i.e. Ruby). Once people learned this they won't go back.

Re:Ask HN: How do you deal with the NodeJS Pyramid of Doom? by hacknat on Monday February 11, 2013 @08:46PM (#5204704)
First of all size is a relative thing. It depends on what you mean by big. I would not write a monolithic code base with JavaScript. That's just silly, and is the kind of thing that Dahl and Schlueter have, themselves, been debunking in order to place node in the credible spot it deserves.

Second, you're citing company's that use node in the niche roles that work great for node. For example LinkedIn uses node for mobile rendering, they use Java for everything else (http://hurvitz.org/blog/2008/06/linkedin-architecture) and (http://engineering.linkedin.com/technology). I really doubt that if anybody saw LinkedIn's use of node relative to their use of everything else they would call it "large".

Now relative to most Python and Ruby projects out there...

Yeah - you can use node for large projects

Re:Ask HN: How do you deal with the NodeJS Pyramid of Doom? by klapinat0r on Saturday February 09, 2013 @04:01AM (#5192162)
I'm not familiar with the "Pyramid of Doom" term, but I'm guessing Callback Hell? Apart from the mentioned use of promises, here's a short writeup of how to avoid getting lost in the abyss http://callbackhell.com/
Re:Ask HN: How do you deal with the NodeJS Pyramid of Doom? by TheMakeA on Thursday February 07, 2013 @10:05PM (#5186069)
I would probably be using promises now if more libraries supported them. It seems like for now I'm left having to wrap functions myself... (let me know if I'm wrong!)
Re:Ask HN: How do you deal with the NodeJS Pyramid of Doom? by tgriesser on Friday February 08, 2013 @12:09AM (#5186392)
Promises, with q is my preferred method.

https://github.com/kriskowal/q