• 0 Posts
  • 38 Comments
Joined 1 year ago
cake
Cake day: July 1st, 2023

help-circle



  • I think comments should be a last resort when all other methods are inadequate. Proper git commit logs have helped me many times to understand why a certain thing is needed.

    Git logs don’t need maintenance either. They always tell what was true when the code was written. Comments need maintenance, and are often difficult to keep updated.

    You can write a detailed comment about the whys of a particular function, only for it to become outdated in weeks when the functionality has changed.

















  • Often when I ask “why” too many times, it’s because the coder chose the most convoluted approach to the problem.

    Like when someone inherited an entire class just to access a single method, but it turned out he actually didn’t need that method, so he added an extra if statement in that method and a Boolean flag so it can do the thing he actually wanted.

    And this was someone who consider himself a senior programmer.