Naming Structures - C# Coding Standard 6

 

In C#, we mainly use Structures when instance size is smaller than 16 bytes and short lived, which can commonly have embedded in other objects. Today we discuss what are the common rules which we need to follow while writing code with Structures (called as struct). 

             We should name with non or noun phases

             We should not use reference types like String in structure 

             Struct is immutable type, so we cannot use mutable value types in structure 

             To use value types, implement IEquatable (Of T).