Comments at the End of Long Code Blocks

Problem
You want to make it easier to follow the flow of execution of long code blocks.

Solution
Consider adding a remark to the right of the closing curly brace of a block that is greater than 20 lines.

Example

public void DoWork(string[], text)
{
    if ( text != null )
    {
        foreach (string t in text)
        {
            // Many statements here.
            ...
            ...
        } // Explain what's going on.
    }
}

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