4 ms·
Disagree. Comments can add "section headers", while keeping the code flow linear, so I can skim it just like I skim an article. With methods, I have to jump bac
by nicoburns 7y ago
Disagree. Comments can add "section headers", while keeping the code flow linear, so I can skim it just like I skim an article. With methods, I have to jump backwards and forwards and have to remember my place as well as think about the code. This introduces unnecessary overhead.
- christophilus 7y agoI’m with you 100%, but I suspect that we’re a minority. For me, linearity of code is directly proportional to legibility of code. It’s not clear to me whether or not this is universally true, or whether this is an individual preference.
- networkimprov 7y agoMinority, maybe not. There's 20+ upvotes on my original comment re single-caller functions -- much more than replies contradicting it.
- dragonwriter 7y ago> Comments can add "section headers", while keeping the code flow linear, so I can skim it just like I skim an article. Yes, and decomposition provides an outline, which is faster to skim than an article. There's a reason tables of contents are a thing; they let you find wheat you care about much faster than linear text with section headers. With code, they also have the advantage of allowing you to make use of step-over/step-into debugging.