Picking a good name for a class/method is often very difficult. But if the names are chosen carefully the code often needs no further documentation.
For instance compare these two simple examples (they are functionally equivalent):
Although the second example has less comments, I feel that it is better documented because it is self-describing:
- The default class-comment that is inserted by Visual Studio is useless. The name of the class is already sufficient documentation.
- The second example has good names for the fields; further comments are not necessary.
- The first example has comments about stuff that is very obvious (every developer should already know what a constructor does).
- The first example explains the sorting of the parameters but every developer can see what is going on. The second example instead explains why the parameters need to be sorted.
If your code is written cleanly then you don’t have to document what it is doing. But you may have to document why it is doing it.