Skip to content

Comment on WebGL + Node.js + WebSockets = A Web Technology Perfect Stormparent

Comments

> but any sufficiently complex JS app tends towards callback spaghetti

Callback spaghetti is quite easy to avoid.

> and maybe I have been doing something wrong

If you have callback spaghetti, regardless of the complexity of the app, you are most likely doing something wrong.

> I don't see it as a huge leap forward from what can be done with Twisted + Python, or Go

Of course not, but it's not hard to imagine that Node.js will have the biggest ecosystem in this space and with it comes advantages (and perhaps disadvantages).

> Callback spaghetti is quite easy to avoid.

That's what people say about most bad programming practices. "It's not the language, you can write good code in the language." This doesn't really help, though. The reality of programming is that different languages encourage different styles of programming. They shape the eco-system, the space of the solutions you will find for you problems.

JavaScript lacks tools for managing complexity. I don't work with it a lot, but most of the JS code I've seen recently was, in fact, callback spaghetti (with arbitrary global state modifications). That's the ecosystem the language created. Hearing how it's avoidable doesn't make my life any easier when I work with such code.

This is subjective and anecdotal, but every large JS framework whose source I've examined shows this tendency towards spaghetti.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.