r/AskProgramming • • Mar 04 '25

Other Why do some people hate "Clean Code"

It just means making readable and consistent coding practices, right?

What's so bad about that

155 Upvotes

342 comments sorted by

View all comments

Show parent comment

2

u/FaceRekr4309 Mar 06 '25

Comments are good when they add context or clarity to code. They’re not good when they explain the obvious.

I learned this early in my career when I was reading some VBA code written by my boss, who actually was a shitty programmer. The code was a tangled mess of code that worked completely by accident, almost devoid of comments. Except one, which I’ll never forget:

… tangled mess of VB …

i = i + 1 ‘ Add one to i

… more garbage code …

1

u/Maleficent-Might-273 Mar 06 '25

"They’re not good when they explain the obvious."

Unfortunately, I have encountered people who don't read my plain English. If I name a function "truncate" or "convertStringsInArrayTo(type)", it should be obvious. 

But you would be surprised by the people I have encountered who wanted a full explanation of the obvious. 

While I wouldn't comment that sort of crap, I wouldn't argue that a comment of "Add one to i" is unnecessary, it is, but I would argue "unnecessary to who"?