21

“Good comments explain why, not what,” says Andy Marks. “Do more of the former and none of the latter. A well named method or variable will beat a well-written comment every day.”

Comments
  • 2
    gotta love it when there's a comment along the lines of "create new window" followed by the function call "create_window"
  • 3
    @karwler I comment even the most obvious things, because sometimes that helps me simplify my code. For example, I overwrote a function of a class to extend its functionality, but when I was explaining in the comment why this was necessary I realised that it was not, because the class already had a way to achieve the same result, except in a slightly different way. If you know what the code is doing you can always ignore the comments, but you when you're confused it can make a big difference 😇
Add Comment