2 ms·
I had the opposite experience. I never read a comment worth reading. Reading code was always strictly better. Truthful and often easier to parse and understand
by scotty79 4y ago
I had the opposite experience. I never read a comment worth reading.
Reading code was always strictly better. Truthful and often easier to parse and understand.
And with code you can actually converse by putting in breakpoints, disabling parts of it and observing it what it is actually doing, how and infering why.
Documentation was always dead almost always outdated prose.
Even when it was up to date and accurate I often understood what the person writing a comment actually meant only after I read and understood the code it was referring to.
- rich_sasha 4y agoPerhaps it comes down to a preference of reading code depth-first vs. breadth-first. Reading code only is best for depth-first I guess. Suppose function A has a call graph that is 3-6 levels deep, with 3 immediate children. If you want to read it breadth-first, you'll want some context as to what the three children do. If you want to read it depth-first, the comments are somewhat redundant, because you're going down to the source anyway. I rarely have a desire (and even less often a strict need) to understand the whole call graph of a function. If it works fine, tests pass, and I want to understand / change one specific behaviour, I need to grok a slither of the entire possible call graph. Comments help guide where I'm going then. If grokking the whole thing, I see how comments are at best a waste of space.
- mason55 4y ago> infering why To me, this is where the most valuable comments are. The more that your code is a representation of business logic, the more you have weird "whys" to fill in. Any kind of plan that involves everyone on the team inferring the same "why" is a terrible plan in my book.