DEV Community

Discussion on: ✨ 5 damn easiest soft skills💡 needed to become a 10X🔥...Yes...10X🔥 Software Engineer ✔️

Collapse
 
pancy profile image
Pan Chasinga

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.

Collapse
 
mrsaeeddev profile image
Saeed Ahmad

Yeah. Both things are necessary i.e expressive comments and cleaner code.

Collapse
 
sonicoder profile image
Gábor Soós

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.

Thread Thread
 
pancy profile image
Pan Chasinga

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.

Thread Thread
 
mrsaeeddev profile image
Saeed Ahmad

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.