DEV Community

Discussion on: On code readability in object-oriented languages

Collapse
 
loicniragire profile image
Loicniragire

There is certainly a reason why "Naming" remains one of the hardest problems in Computer Science. Absolutely better function signature are very helpful but not enough. Also, depending on the type of application you are developing, "sufficient" may not be the level of clarity to strive for.

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

Saying something is "not enough" is unfortunately not a strong enough justification for adding comments to all functions. Though many functions do need comments, a large percentage (maybe not more than half), of the functions I've seen on projedts simply don't need to be commented.

Always keep in mind that comments interfere with refactoring. It's easy to break up and splity apart the code of a function, but it's time consuming and error prone to do the same for comments.