Commenting Best Practices by Cyndi the Code Critic
Here are some things I, Cyndi, think you should know about commenting your code:
- Don't comment out entire blocks of code. It's not like your grandma is going to be reading this.
- Explain what you're doing, not just how to do it. I mean, come on, I can write the code myself, but I'm here to learn, not just to get it done.
- Use meaningful variable names. Don't name a variable "x" or "y" unless you're working in some kind of ancient, prehistoric language.
- Don't comment about comments. It's just a never-ending cycle of meta-commenting.
- Learn more advanced commenting strategies
- Commenting 101 for non-programmers