C# Comments


This is another of my pet peeves when looking at other people’s code. If you add a comment, using the double forward-slash //, then add a freaking space after // to make it stand out from code that has been commented out. It pisses me off right, left and center to see this:

//TODO blah, blah

…or this:

//Here is where you add...

Why not just do this, so flipping simple:

// TODO:

This will avoid any potential mistake when glancing over the code, where the code below has is clearly commented out code, and the first examples above are not:

//var numDays = int.Parse(Console.ReadLine());
//var numPeople = 5;
//var numPeopleShared = 0;

Do feel free to share your opinion and experience on the same.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s