Hacker News new | ask | show | jobs
by kbutler 4621 days ago
I've been maintaining some code written with this philosophy, and I find it lacking.

Code is very good at answering "How" but often the reader needs to know "Why" or "Why not".

In fact, the maintainer of your code will rarely be reading it to figure out how it is working - almost always the next person looking at your code will want to know why it is not working, or will be attempting to change the behavior.

Comments can guide as to pitfalls that you've avoided in your implementation and can answer the all-too-frequent question, "What were they thinking?!"

2 comments

Another problem: It seems like developers in the "clean code needs no comments" crowd are also the ones least likely to write clean code in the first place.
Clean code needs no internal comments, but that's very different from whether software contracts (which are inherently outside the code operation and therefore need comments) need comments.

I strongly dislike extraneous comments. But even some clear code needs some external communication alongside it.

Yes. At this point, I really only write "why" or "why not" comments.