Node.js Makes for Cluttered Code
Node.js Makes for Cluttered Code
Join the DZone community and get the full member experience.
Join For FreeAccess over 20 APIs and mobile SDKs, up to 250k transactions free with no credit card required
This issue goes out of control sometimes, leading to dozens of nested functions and stuff. CoffeeScript’s syntax makes it a little bit easier to deal with it but it’s still no solution. I think it’s too late for JavaScript for this but maybe, CoffeeScript or some other dialect might provide c# 5 style async handling. -- Ekin Koc
Sounds like CoffeeScript addresses, but does not get rid of, the problem of cluttered code in node.js. Some commenters seem to think that part of the solution here should be found in how the programmer approaches flow control. According to commenter Shankar, Moberg was trying "to use sequential flow control on [an] event-driven platform," and this could be fixed through flow control methods posted on github (LINK). This may, like CoffeeScript, address some of the issues of polluted code, but Moberg suggests that the problem here may not be as much with node.js as it is with the nature of JavaScript itself:
I am just saying that event driven programming in JavaScript could be made much easier. -- Peter Moberg
Comment with some further suggeststions for cleaning up cluttered code, or let us know of your own experiences with node.js below.
#1 for location developers in quality, price and choice, switch to HERE.
Opinions expressed by DZone contributors are their own.
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}
{{ parent.urlSource.name }}