Open
Description
in first example
- 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]
- FlagsAttribute should have member with zero value, e.g. "None=0," [RCS1135 1X]
- use of explicit type (e.g. Type, string, Colors) should be replaced by var [IDE0007 4x]
- foreach should have executing statement surrounded by curly braces [IDE0011 2x]
- 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.
- ID: 636447d8-cbfd-8fd0-1caa-b9ea5cf39f74
- Version Independent ID: 357fbd3c-5a0d-db79-306b-f4b7fb3f4727
- Content: Enum Class (System)
- Content Source: xml/System/Enum.xml
- Product: dotnet-api
- GitHub Login: @rpetrusha
- Microsoft Alias: ronpet