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:
- Method arguments (can be abbreviated, for example, "nmbrInput")
- Local variables (can be abbreviated)
- Field name (can be abbreviated)
Objects that should utilise PascalCase:
- Class name
- Constructor name
- Method Name
- Constants name
- Properties name (can be abbreviated)
- Delegate name (can be abbreviated)
- 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
{
}