5

I always enjoying snacking on some popcorn while people argue so, what are your thoughts:
Comments in your code - good or bad?

Comments
  • 3
    Good, but tedious and annoying when interrupting a coding session
  • 2
    Good to explain chunks of code, bad if you're explaining every line (unless you're in a beginning programming course, in which case do what you gotta do to retain important concepts). If I'm looking at your code, I know that this loop is iterating through the array; tell me instead an overview of what's going on inside the loop.

    Just my two cents on the topic
  • 1
    I read somewhere: "— I don't comment my code. If it was hard to write, must be hard to read."

    Haha It was funny, but I'm used to explain a lot in the comments because I'm a beginner.
  • 1
    @estewart23 yeah. I believe in "why" comments but never "what" comments. As I see it, if you name your methods and variables well, you should rarely NEED to use either one anyway.
Add Comment