DEV Community

Discussion on: Coding a Better World Together with Uncle Bob

Collapse
 
mrwormhole profile image
Talha Altınel • Edited

"Comment is a lie, it degrades over time and no one maintains it." -code book seller bob

This guy is the best marketing person I have ever heard. Totally out of touch with today's doc gens and the importance of comments.

Learn it from here folks, don't do jabba for 25 years or you end up like this

Collapse
 
bigbott profile image
bigbott

If your code requires comments, it is probably requires refactoring in the first place. And/or appropriate architectural pattern. Possibly simpler one.

Collapse
 
mrwormhole profile image
Talha Altınel

wrong, comment is for docs and drawing attention to avoid mistakes

google.github.io/styleguide/go/dec...

Thread Thread
 
vtsen profile image
Vincent Tsen

Only if it is unavoidable. Assuming if you can code without comment, that can also avoid the mistakes, that will be ideal.

Thread Thread
 
mrwormhole profile image
Talha Altınel

I agree on that, there is a balanceful ground, definitely we don't wanna read 180 lines of comments per 2 lines of code

Collapse
 
vtsen profile image
Vincent Tsen • Edited

I used to write a lot of comments but I think if the code can explain itself, then you don't need to write comment. That is the ideal case.

However, in a complex software environement, comment usually cannot be avoided because when you look at the code, you have no idea. You rely on comments to tell you. Thus, comments become useful.

Collapse
 
mrwormhole profile image
Talha Altınel

Exactly, I don't write comments for my personal projects but in bigger team projects, it is nearly needed and this also brings the necessary documentation policy for the business logic, not just code comments, it is 100% needed if you are building a library etc...

Thread Thread
 
vtsen profile image
Vincent Tsen

Good one. I'm on the same page with you.