39

Not commenting my code because "it's so clear what I'm doing, how could I ever forget what my own lines of code do."

Comments
  • 2
    Yep. When I started Lambda, they said to always comment your code. But I was like “Pfft, maybe when my code is complicated. No way I forget how *this* works.” *months later* ... how did I ever think I was going to freaking remember jQuery?
  • 3
    Readable code rarely needs comments. Change my mind.
  • 2
    @buttars Sometimes it’s not about that singular function being readable. Sometimes it’s about being able to find it.
  • 0
    @buttars Sure. Had to add a line today, specifically cleaning out a certain Gradle-generated folder for the compileJava task, even though we have cleaning tasks defined that serve that purpose as well.

    Yet there is a documented issue with Maven/Gradle that will cause an unhandled exception in the Java compiler itself, if the seemingly redundant line is omitted.

    It is entirely obvious what the line does, as it is easily readable, yet when undocumented, no one knew why the fuck this belongs there and is crucial for the build process.
  • 0
    Comments can be hard to understand too and in the worst case they are outdated, because someone change the code but not the comment.
Add Comment