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

341 comments sorted by

View all comments

Show parent comment

1

u/flatfinger Mar 05 '25

Many documents which suggest various practices get abused that way, ranging from the C Standards to the AP Style Guide. With regard to splitting up functions, there are times when splitting up long functions can be helpful if there are sections whose behavior can be fully described in English more concisely than in code. Treatment of corner-case behaviors, however, can often be described more concisely in code than in English, especially in cases where a particular piece of code doesn't handle a corner condition because it's handled somewhere else. If two pieces of code, either of which could take responsibility for handling a corner case, appear near each other in the source file, a reader will be able to determine that exactly one does take responsibility than if the pieces of code were pulled out to separate functions.