3 ms·
the term callback hell comes to mind, although I'm not sure that's the entire problem you quoted
by conceit 11y ago
the term callback hell comes to mind, although I'm not sure that's the entire problem you quoted
- SideburnsOfDoom 11y agoI wasn't talking about callback hell (1) but if you want to do so - the point is that if the "nested callbacks" style is objectively worse (and this seems likely) then this can actually be measured. Lines of code and cyclomatic complexity (2) is just the start. You would have to do something like ... e.g. take a group people skilled in some other programming language, give them a basic grounding in Javascript, and have them work with some JS code samples with and without nested callbacks. If there is clear difference in code comprehension, time to modify the code, lines of new code to accomplish a goal, and resulting bug count then you can have an informed opinion on if this code style is really objectively so bad. That seems like a costly and time-consuming procedure. But if some academic institution did this I'd be pleased - some scarce data and some actual science is IMHO is worth a thousand opinions in this kind of recurring stylistic debate. 1) http://callbackhell.com/ http://callbackhell.com/ 2) https://en.wikipedia.org/wiki/Cyclomatic_complexity https://en.wikipedia.org/wiki/Cyclomatic_complexity
- deleted 11y ago[deleted]