Hacker News new | past | comments | ask | show | jobs | submit login

Yeah, I've got to agree. Reading the original article ("Escape from Callback Hell" with the subtitle "Callbacks are the modern goto"), it starts with this:

Callbacks are used to structure programs. They let us say, “When this value is ready, go to another function and run that.” From there, maybe you go to another function and run that too. Pretty soon you are jumping around the whole codebase.

So, essentially this sounds like the author is saying functional programming is considered harmful. Which, on the face of it is not true.

Of course you can write spaghetti code in any paradigm and using any technique. The whole point of callbacks (and passing functions around as values, more generally) is that you have one more tool in your toolbox to achieve things that are difficult otherwise. Suggesting they are harmful in such a hyperbolic way is throwing the proverbial baby out with the bathwater.

I'm sure there's a case to be made for properly structuring a callback-heavy application, but methinks a more nuanced approach may be in order here (and in general...sigh).




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: