Highlight correct/incorrect examples in rules documentation.

Mar 30, 2013 at 10:48 PM
Currently in some rules documentation there are examples of correct code, in some are examples of incorrect code and in some both.

It would be easier for readers, if it world be highlighted, is the example good or bad.
It could be done by making it bold and/or uppercase.

E.g for example in http://www.stylecop.com/docs/SA1504.html
For example, the following property would generate a violation of this rule, because one accessor is written on a single line while the other accessor snaps multiple lines.

NOT RECOMMENDED:
public bool Enabled
{
    get { return this.enabled; }

    set
    {
        this.enabled = value;
    }
}
The violation can be avoided by placing both accessors on a single line, or expanding both accessors across multiple lines:
RECOMMENDED:
public bool Enabled
{
    get { return this.enabled; }
    set { this.enabled = value; }
}
public bool Enabled
{
    get
    {
        return this.enabled;
    }

    set
    {
        this.enabled = value;
    }
}


It could be considered to highlight incorrect section with red background and correct with green background
Mar 31, 2013 at 12:06 PM
I don't agree with the coloring but I agree in some title to emphasize what's what.

By the way, what's up with http://www.stylecop.com/ ?