E. Report on Coding Standards - SwinbeeMiles/MyBattleship GitHub Wiki

Documented by: Zikri Dawek

In order to further streamline the code conversion from Visual Basic to C#, a coding standard should be followed for better understanding between programmers. Some of the most notable coding standard that can be used are PascalCase and camelCase.

An example of PascalCase is "NumberGenerator".

An example of camelCase is "studentID".

The following is a list of excerpt on where and when these coding standard should be utilised:

Objects that should utilise camelCase:

  1. Method arguments (can be abbreviated, for example, "nmbrInput")
  2. Local variables (can be abbreviated)
  3. Field name (can be abbreviated)

Objects that should utilise PascalCase:

  1. Class name
  2. Constructor name
  3. Method Name
  4. Constants name
  5. Properties name (can be abbreviated)
  6. Delegate name (can be abbreviated)
  7. Enum type name

An example for using PascalCase for class and method names:

{
  public int AddNumbers()
  {
    //...
  }
  public int SubtractNumbers()
  {
    //...
  }
}

An example for using camelCase for local variables:

string studentID;
int studentAge;

For interfaces, use the prefix I to signify them. An example can be seen as follows:

{
}
public interface ISubtraction
{
}