Coding Standards
From Open Forex Platform Wiki
The source code of the Platform is comprised of C# code (and a very small C++ part for integrations). The code follows a strict coding notation.
- Indentation
Tabs are the only allowed symbols to be used for indentation. The indentation must be compatible with the Microsoft Visual Studio 2005/2008 .NET indentation standard.
- Class Names
All class names start with a capital letter and follow the camel naming notation (for ex. DataStoreControl). Names for user interface Form classes must end with "Form", and control classes - with "Control".
- Class Members
Private and protected member names start with an underscore and follow the camel naming notation(for ex. "_myVariableOne"). Public members must follow the guideline for Class Properties.
- Class Properties
All class properties names start with a capital letter and follow the camel naming notation (for ex. "MyPropertyOne").
- Method Names
All method names start with a capital letter and follow the camel naming notation, unless auto generated by the Visual Studio.
- Method Parameters
Method parameters start with a small letter and follow the camel naming notation.
- Method Variables
Local method variables start with a small letter and follow the camel naming notation. The method variables must be declared as close to their initial usage as possible.
- Abbreviations
Abbreviations are strongly discouraged and should be evaded.
- Commenting
Each class must have a short or medium sized description before its declaration in standard format. The description must give a rough idea of what the class purpose is.
Example class:
/// <summary>
/// My test class.
/// </summary>
class MyClass
{
int _myMember = 1;
/// <summary>
/// Property.
/// </summary>
public int MyMember
{
get { return _myMember; }
}
/// <summary>
/// Constructor.
/// </summary>
public MyClass()
{
}
/// <summary>
/// Test method.
/// </summary>
public bool MyMethod()
{
_myMember = 2;
return true;
}
}

