News for hackers. Stuff that matters.
Re:On Comments in Code by majewsky on Wednesday June 16, 2021 @07:01AM (#27527079)
This is Damian Conway's "coding in paragraphs" advice, and in my experience, it's the single best advice for more readable code. When you have a large function, split the code into blocks with a heading comment on each section. That way, you can skim through the function body quickly by just reading the headings, then dive deeper into whatever block you're interested in. Like section headings on an article.

There are no comments on this comment yet.