Using Block Comments in C#

Problem
You’d like to know how to properly use block comments in C#.

Solution
Avoid /* */ comments that interfere with the flow of executable code. Optimally, use block comments when they span more than three lines.

Examples

// Not good.
void Login(string userName /* a user's username */, string password /* a user's password */)
{}

// OK, but not great.
void Login(string userName,      // A user's username.
    string password              // A user's password.
)
{}

// Much better. Ideal.
/* ************************************************
 * Log into the application with a given 
 * user's [userName, password].
 * ************************************************/
void Login(string userName, string password)
{}

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 )

w

Connecting to %s