Lot of blabbling for a simple concept: do not abuse nesting. It's the case with control statements, it's still the case with functions, and even more with async functions. Oh, and callbacks definitely exist in other languages, like C. What's the deal with this trend of setting up a whole website for a (basic) blog post?
Callback Hell (2016)
51–60 of 170 posts
Re: Callback Hell (2016)
#52> In other languages like C, Ruby or Python there is the expectation that whatever happens on line 1 will finish before the code on line 2 starts running and so on down the file. As you will learn, JavaScript is different. A lot of beginner guides to various programming languages make this mistake of associating a certain property with a language as if it's inherent. In this case, async code - while sold as a main fe…
> A lot of beginner guides to various programming languages make this mistake of associating a certain property with a language as if it's inherent. In this case, async code - while sold as a main feature of the NodeJS platform - is in no way exclusive to, or even an inherent part of, Javascript/ES the language. Exclusive no, but considering JS's original environment and constraints it is in fact pretty inherent. `se…
Re: Callback Hell (2016)
#53I enjoy using promises.
Re: Callback Hell (2016)
#54The key piece of advice. It helps tremendously with backtraces if your program crashes.
Re: Callback Hell (2016)
#55It was honestly a mystery whey people would use this hard to read nested structure when you can write things in a more readable way.
The best theory I can come up with is that it is easier to write that way if, for instance, you are answering a question on StackOverflow, and these examples just find their way into production code via copy/paste without people understanding how they work.
Re: Callback Hell (2016)
#56Lot of blabbling for a simple concept: do not abuse nesting. It's the case with control statements, it's still the case with functions, and even more with async functions. Oh, and callbacks definitely exist in other languages, like C. What's the deal with this trend of setting up a whole website for a (basic) blog post?
Re: Callback Hell (2016)
#57Lot of blabbling for a simple concept: do not abuse nesting. It's the case with control statements, it's still the case with functions, and even more with async functions. Oh, and callbacks definitely exist in other languages, like C. What's the deal with this trend of setting up a whole website for a (basic) blog post?
Re: Callback Hell (2016)
#58[0] http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?m=1
Re: Callback Hell (2016)
#59Not sure this problem goes away by giving names to anonymous functions, which seems to be his suggestion
Re: Callback Hell (2016)
#60Last updated in 2012. A lot has changed since.