Callback hell is a design choice.
blog.caplin.com
blog.caplin.com
You can't just OOP everything in node because evented code breaks that. Once you touch a database or filesystem, you are in evented land, and all the callbacks that come with it. Saying you should just OOP things in Javascript is not wrong, but it doesn't work for node.
There are a few libs that make callback oriented things nicer, but they still kind of suck and OOP is not as much fun even with those tools in place.
DirectoryScanner.scanLibraries = function(librariesRoot) { // Asynchronous Function Callback function // | | fs.readdir(librariesRoot, this.onLibrariesDirRead.bind(this)); };
All I've done is pass in a bound method on an object as the callback function. OOP does work for Node as far as I can tell I broke nothing with my code, it's all async/evented...
Can you give me an example as to how my coding style would break Node? I'm genuinely confused.