Using Block Comments in C#

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

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


// 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: Logo

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