The cleanest code still takes more cognitive energy to understand than plain natural language comments. I don't see the need to strive for less comment. Every function, class, or module should have comments. Especially when today's tooling can easily generate docs out of them.
a good expressive comment at every abstraction level is an indication of a well-thought-out design from the developer. The same indication can be evident from a unit test.
If you need more cognitive energy to understand than it is not the cleanest code in my opinion. Comments are always longer and can quickly become obsolete. Nothing enforces them to stay up to date...if you forget it, it remains there unnoticed.
I disagree. In languages like C/C++ or Rust, how ever clean the code is you still can't comprehend easily the intention until you've read through a few lines into a function.
In Go, every exported function is expected to have an accompanying comment. That's considered good practice.
I think it depends on codebase. If its small then code can speak itself what it is intended for. But if it's larger codebase then there should be comments to briefly explain the intentions of programmer.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The cleanest code still takes more cognitive energy to understand than plain natural language comments. I don't see the need to strive for less comment. Every function, class, or module should have comments. Especially when today's tooling can easily generate docs out of them.
a good expressive comment at every abstraction level is an indication of a well-thought-out design from the developer. The same indication can be evident from a unit test.
Yeah. Both things are necessary i.e expressive comments and cleaner code.
If you need more cognitive energy to understand than it is not the cleanest code in my opinion. Comments are always longer and can quickly become obsolete. Nothing enforces them to stay up to date...if you forget it, it remains there unnoticed.
I disagree. In languages like C/C++ or Rust, how ever clean the code is you still can't comprehend easily the intention until you've read through a few lines into a function.
In Go, every exported function is expected to have an accompanying comment. That's considered good practice.
I think it depends on codebase. If its small then code can speak itself what it is intended for. But if it's larger codebase then there should be comments to briefly explain the intentions of programmer.