Re:Want cleaner code? Use the rule of six
by nicoburns on Sunday September 25, 2022 @08:01AM
(#32970558)
I like putting comments above paragraphs of code so that you can skim it by trusting the comments, but you can also inspect any individual paragraphs implementation without losing your context.
[ Parent
| on HN ]
Re:Want cleaner code? Use the rule of six
by thebackup on Monday September 26, 2022 @12:38AM
(#32979489)
Agreed. A comment can also explain things that a function name cannot.
Iām all for splitting code into paragraphs with a well written comment above each.
Of course I also extract functions, but only when there are obvious benefit, like removing repetition.