8000 1st example: enum does not need terminating semi-colon, and other sins · Issue #1465 · dotnet/dotnet-api-docs · GitHub
[go: up one dir, main page]

Skip to content
1st example: enum does not need terminating semi-colon, and other sins #1465
Open
@DickBaker

Description

@DickBaker

in first example

  1. code erroneously add a semicolon at end of each enum statement (after closing curly) but this is not required and they should be removed [RCS1055 3x]
  2. FlagsAttribute should have member with zero value, e.g. "None=0," [RCS1135 1X]
  3. use of explicit type (e.g. Type, string, Colors) should be replaced by var [IDE0007 4x]
  4. foreach should have executing statement surrounded by curly braces [IDE0011 2x]
  5. myColors should mark local variable as const (e.g. const Colors myColors) [RCS1118 1Xx]
    (OK one less off my Fixed broken links, restored deleted content #3 smell-list!)

And all the rest of docs to exhibit best patterns & practices

  • I got bored enumerating code improvements, but poor examples are plentiful alas

Suggest you put some interns on "find the bad smells" hunt and reward highest score

  • anybody worth their salt will channel all doc examples into Roslyn and be done in a jiffy

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0