C# Developers: Comment your code!

I was just thinking how easy it is to tag all of your code with the essential metadata it needs:

  • What does it do?
  • What are the inputs?
  • What are the outputs?

Now we can, of course, put in plenty more metadata, such as general remarks, what exceptions are thrown, examples of how to use your code etc. What astonishes me is how much code I see which doesn’t even have the essentials listed above. If you’re using Visual Studio you really have no excuse all it takes is literally three /’s and visual studio will put in the skeleton for you.

You will all comment your code religiously from now on, and then you will use Sandcastle to generate a compiled help file from it.