Coding Standards - HaydosBruh/Battleships GitHub Wiki

Below are our coding standards and naming conventions for c#

DO use PascalCasing for class names and method names. 1

DO use camelCasing for method arguments and local variables. 2

DO use PascalCasing for abbreviations 3 characters or more (2 chars are both uppercase) 3

DO use predefined type names instead of system type names like Int16, Single, UInt64, etc 4

DO use implicit type var for local variable declarations. Exception: primitive types (int, string, double, etc) use predefined names. 5

DO use noun or noun phrases to name a class. 6

DO prefix interfaces with the letter I. Interface names are noun (phrases) or adjectives. 7

DO name source files according to their main classes. Exception: file names with partial classes reflect their source or purpose, e.g. designer, generated, etc.

8

DO organize namespaces with a clearly defined structure. 9

DO vertically align curly brackets. 10

DO declare all member variables at the top of a class, with static variables at the very top. 11

DO use singular names for enums. Exception: bit field enums. 12