| > That is a gross generalization. I do not, in general, comment my code (and I know and work with many other programmers who do not) but I go to great lengths to ensure that my code is easily understandable. You're almost certainly not succeeding, because unless you work with a language far more expressive than one I've seen previously, then your code can not express all the information I need to work on your code. A complete lack of comments is on my top three list of "bad times ahead" warning signs when I inherit a codebase. The other "bad times" warning flags are: * A lack of documentation * A lack of automated tests (integration, unit, or otherwise). These three things can make or break maintainability on their own, and they also often serve as a proxy indicator for just how much thought an engineer put into fully understanding the invariants and edge-cases of the code they've written. The hard part of writing comments, documentation, and tests is in understanding invariants and edge-cases. The easy part is writing down what you've understood. > I suspect we work in different sections of the industry, but in my world, comments are often a red flag rather than a welcoming sight! Unless your section of the industry has no interest whatsoever in maintainability, I'm not sure our respective sections are very different. |
You seem pretty convinced, so I don't have high hopes of changing your mind with a post on an internet forum, but in my experience most comments can be replaced by clearer names, better abstractions and better tests. The ones that can't tend to be about the "why" rather than the "what".
>Unless your section of the industry has no interest whatsoever in maintainability[...]
My primary motivation is maintainability, and your claims to the contrary come across as pretty condescending.