I have never had a ‘standard’ in mind on commenting code. There are principles that one should think of, such as method names should be descriptive enough that comments don’t necessarily have to repeat what method names communicate.
I found this great post by Eric Lippert. There are a few things I like about what he did:
- One knows the reason for a method. It doesn’t exist arbitrarily. It links to functionality that should exist as defined by the spec.
- Promotes single responsibility principle, because a method should only do one thing, and exist for the purpose of doing that thing.
- It just makes someone’s code more understandable for when a new person gets on board. Better communication. This is good.