Commenting out Code in C#

Problem
You want to know the best way to comment out blocks of code.

Solution
Use single-line comments instead of block comments to comment out blocks of code. Be sure to place the // symbol in the first column. This helps make it clear that it isn’t a standard comment.

Comments
Avoid commenting out executable lines of code; especially, before checking it in. Lines of code that are commented out and ignored tend to become dead code.

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s