DEV Community

Discussion on: Should comments in code be considered failures in coding?

Collapse
 
rossdrew profile image
Ross

Sounds like the entire thread has reached a consensus that comments do indicate mistakes but that sometimes mistakes and therefore comments are necessary.

And that the original statement is pretty accurate (except, sometimes it's also other peoples failures)

If you fail, then write a comment; but try not to fail.

Collapse
 
combinatorylogic profile image
combinatorylogic

I'd say lack of comments is a very clear indication of a pile of crawling creepy mistakes.

It's an indication of a wrong paradigm choice that lead to proliferation of a boilerplate code - all that code should have never existed in the first place.

It's an indication of a decision to forget all the important thought process that lead to the current code architecture, which will unavoidably lead to repeating the already made mistakes over and over again while maintaining this code in the future.

It's an indication of a lack of discipline in general, which, by proxy, results in a high number of bugs.

I'd stay as far away as possible from an uncommented code.

Thread Thread
 
rossdrew profile image
Ross

I'd say lack of comments [is] an indication of a wrong paradigm choice

Surely if your paradigm is correct, it easier to express without comments. I would say the exact opposite. Bad paradigm choice leads to need for comments to explain compromises made due to lack of express ability. Code is made closer and closer to English to make it more expressive, if you need to drop into English, the abstraction has failed to be expressive enough.

Thread Thread
 
combinatorylogic profile image
combinatorylogic • Edited

Even if your code reads just like plain English and it's as close to semantics of your problem domain as possible, it still only explains the "how" part. The "why?" part is missing.

Thread Thread
 
rossdrew profile image
Ross

yawn

Thread Thread
 
combinatorylogic profile image
combinatorylogic

This is what religious fanatics say when they're cornered. Uncle bob zealots are the worst of the worst, you're all beyond any redemption...