when I’m writing code I find that comments are more than just a tool for explaining what’s going on - a lot of the time, I have to explain to myself why I didn’t do something a certain way, as to avoid dumb half-hour mistakes that get me into the same previous mindset I was in when writing the code
comments are important, not just to know why you did do something, but also to know why you didn’t do something.
Very true. Comments do have a place in a code base. Many times, comments are dismissed as content that only clutters the codebase, however if used correctly, they can save future developers and yourself from introducing regressions, bugs and overlooking a corner case that's not obvious.
However, before writing a comment, you should question whether you can extract logic to well named variables or refactor the code to make it more readable and clear without comments.
My 2¢.
















