TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C# Coding Standard
Search

Category: Data types

Synopsis:Various data types


Description:

Coding Rules

NameCheckedSynopsis
10@201 Use an enum to strongly type parameters, properties, and return types
10@202 Checked automatically with code checker Use the default type Int32 as the underlying type of an enum unless there is a reason to use Int64
10@203 Use the [Flags] attribute on an enum if a bitwise operation is to be performed on the numeric values
10@301 Checked automatically with code checker Do not use 'magic numbers'
10@401 Checked automatically with code checker Floating point values shall not be compared using the == nor the != operators nor the Equals method.
10@403 Do not cast types where a loss of precision is possible
10@404 Only implement casts that operate on the complete object
10@405 Do not generate a semantically different value with a cast
10@406 Checked automatically with code checker When using composite formatting, do supply all objects referenced in the format string
10@407 Checked automatically with code checker When using composite formatting, do not supply any object unless it is referenced in the format string
10@501 Only use var when the type is very obvious