News for hackers. Stuff that matters.
Re:Interview with Ryan Dahl, Creator of Node.js by k__ on Thursday August 31, 2017 @01:59PM (#15142332)
Somehow I never experienced callback hell.

It always felt like every other code-nesting problem to me.

I mean, nobody talks about conditional hell, everyone acknowledges that you should flatten out your conditionals.

Re:Interview with Ryan Dahl, Creator of Node.js by bartread on Friday September 01, 2017 @07:08AM (#15147456)
I'm inclined to agree. To me callback hell is a symptom of lazy, or perhaps just ignorant, programming. It was never a necessity: if things are getting out of control, create a named function and pass in the name as the callback to make things more readable.
Re:Interview with Ryan Dahl, Creator of Node.js by z3t4 on Saturday September 02, 2017 @04:10AM (#15154893)
When starting with Node.JS I did experience callback hell for about half a year before I found a good tutorial on how to manage the callbacks, and it finally clicked, since then, managing callbacks has become a second nature. The magic trick is to use named child functions instead of anonymous and self calling functions, so you can take advantage of the closure. I find programming this way even easier then writing in a serial non async language, because of the heavy use of function state instead of global state, and I love that in Node.JS modules are not just a "include file" and actually a object that works just like any other object, and can be used in function scope and closures. So instead of importing a bunch of variables to the top scope, you can require them locally and just by looking at the function you can see where all the variables come from, you don't have to know about the outside world to understand what the function does!
Re:Interview with Ryan Dahl, Creator of Node.js by Scarbutt on Thursday August 31, 2017 @06:18PM (#15144432)
In case you are just referring to the browser, callback hell is way more invasive in nodejs than in the browser.
Re:Interview with Ryan Dahl, Creator of Node.js by sah2ed on Thursday August 31, 2017 @03:08PM (#15142901)
Callback hell was real, especially if you worked on projects that decided to join the node.js bandwagon in its early days. Then promises happened.

https://twitter.com/winterbe_/status/541868081308790784

Re:Interview with Ryan Dahl, Creator of Node.js by mikewhy on Thursday August 31, 2017 @03:21PM (#15143054)
Why post a contrived meme as an example? Especially one with a sane solution[1] just below.

[1]: https://pbs.twimg.com/media/B4W2AmaCAAA-heo.png

Re:Interview with Ryan Dahl, Creator of Node.js by sah2ed on Thursday August 31, 2017 @04:44PM (#15143768)
It's an exaggeration, yes, but it does correctly summarize how I felt when I had to work with node.js code bases before stuff like promises became mainstream.
Re:Interview with Ryan Dahl, Creator of Node.js by andreime on Friday September 01, 2017 @06:21AM (#15147303)
An exaggeration could be written for any language. A decent programmer would not write code like the one you showcased as an example for callback hell.

This https://docs.spring.io/spring/docs/2.5.x/javadoc-api/org/spr... is not an exaggeration and I still would not use it to showcase how I felt when I had to work with Java developers.