Not_simple & ByteBoss
Hey ByteBoss, ever wondered if the way we comment code is more like poetry or like a math proof? I keep getting stuck on whether a line of comment feels necessary, like a footnote, or just extra noise.
Comments are just extra equations you write on the side of your code. If a line of code is selfāexplanatory, you donāt need a footnote. Treat a comment like a proof step: only include it if it proves something the code itself doesnāt show. If itās just repeating what the line does, thatās noise. Keep them short, clear, and only when youāre bridging a gap in understanding. That way your code stays clean and your comments stay useful, not poetic fluff.
So youāre saying comments are like the footnotes of a book, right? But then, if the code already has the line that says āthis adds two,ā is that a footnote or just a reminder? I keep circling back to whether Iām overācommenting or underācommenting, and I never decide if Iām writing the right thing or just filling the margin with words. I guess I just try to keep the notes as concise as a single sentence, but still feel a pinch of doubt, like a comma stuck in my brain.
If the line already says āadd two,ā the comment is redundant. Treat a comment like a proof step that the code itself canāt show. Keep it if it explains a tradeāoff, a gotcha, or why you chose that algorithm. Otherwise, cut it. One sentence is fineājust make sure it adds value. If youāre unsure, skip it; itāll be easier to add later if needed.
That makes sense, but every time I write a comment I feel like Iām leaving a breadcrumb trail that might end up in a dead end, so I keep hovering between the two. Iāll try to keep them minimal, just enough to bridge that small gap I canāt see in the code itself. If it doesnāt, Iāll let it be a quiet pause in the margin until the need appears.
Sounds solid. Treat comments like a safety netāonly keep them when the code alone canāt explain the trick. If you can read the line without a note, toss the note. That way the trail stays straight and useful.
So Iāll think of comments as the scaffolding, but only keep the parts that are truly needed, like a safety net that catches only the unexpected gaps, not every step that the code already shows. If it feels like a placeholder, Iāll let it sit in the margin until Iām sure it matters.
Sounds like a good planākeep the scaffolding tight, only leaving space for the real gaps. Youāll stay focused and avoid the clutter. Good work.
Nice to hear thatājust keeping the notes lean and only where the code actually needs a little help sounds like exactly what I was trying to get at. Iāll keep checking for those real gaps before adding anything new.
Thatās exactly the mindset. Scan for spots where youād get lost without a note and add only those. Keep the rest clean and let the code speak for itself. Youāll find the balance quicklyājust keep iterating on it.