2/24/2026 at 1:46:13 PM
I'm glad to see there is a "Beyond the Code" section that discusses comments. Here's what I typically told my students in Intro to Programming" Good comments lend insight into the code. Reading the code itself tells you the what. Comments should explain the why. Comments like "i+=1; /* Increment i */" are of little value. However comments such as "We increment i mid loop so that we can peek ahead at the next value for a possible swap" are more useful. Use a narrative voice when writing comments, like you are explaining the code to your grandparent. This make digestion easier. Remember, code spends most of its life, and most of its expense, in the maintenance phase. The easier you make your code to understand, the less it will cost and the longer it will live.by NoNameHaveI
2/24/2026 at 7:40:18 PM
I prefer comments like "I'm sorry about this, I know it's ugly but I'm in a rush and it's the quickest way to get it working"by dec0dedab0de
2/25/2026 at 6:08:28 PM
Would your Grandma approve of you introducing that technical debt?That’s why it’s important to write comments as if to your grandparents. For the feelings of accountability that it engenders.
by jimbokun
2/24/2026 at 9:22:10 PM
As long as there's a "TODO" tag in the comment to easily search for, then I prefer those comments as well.by stronglikedan
2/25/2026 at 12:39:02 AM
I prefer all "TODO" comments to be well-defined and have a specific ticket number attached to them to ensure they are tracked.I don't see any harm to the occasional "I'm sorry" or humorous comment
by culi
2/25/2026 at 2:11:11 AM
My first team figured that out after a year or so. If it’s really TODO, it should either be addressed before the WIP feature is considered “completed”, or it needs to show up in our work tracking system. Otherwise it just fell through the cracks and would never be prioritized.by e28eta
2/25/2026 at 1:32:12 AM
The number of people I know who honor TODOs is pretty slim, but I find it does in fact help if you get people to stick their initials next to it. Over enough refactors a TODO can lose its meaning and author.TODO (DKH) - This should handle negative numbers
can be helpful later if there's nothing in the requirements about negative numbers. Why do we need to handle negative numbers? Is it for some mystery feature? Performance? Security? What? Why?
'DKH' might recall what they were thinking if you prompt them.
We see what we want to see, and a TODO when we are in a hurry probably won't trigger much guilt or associated motivation to do something about it. Or at least, not as much as if we see our own initials in the TODO.
(Also handy when prepping a commit, since you might have left breadcrumbs in case you get interrupted, and then forget one or two of the tasks you still had outstanding afterward)
by hinkley