Hacker News new | ask | show | jobs
by d0mine 1185 days ago
> comments are code smell [paraphrasing]

Good news: there are kinds of extremely useful comments that do not repeat the code (your comments should not repeat the code). Comments are to express context/intent behind the code: the "why", the high level "what", and almost never the exact "how" (read code for that).

It looks like you only ever encountered the "how" comments. No amount of code refactoring would get you the "why" (context) comments.

1 comments

GIT tells the why.
Yes, commit message is also a good place to provide the context for the commit.