We would like to stick to .NET naming convention, which involes:
Classes and Structs are PascalCase. Example:
class HttpClient
{
}
struct HttpHeader
{
}
Enumerations are PascalCase, same goes for their members Example:
enum HttpVersion
{
OnePointZero,
OnePointOne,
}
Methods and functions, public or private all are cascalCase. Example:
class HttpClient
{
public void connect()
{
}
private bool isConnectionAlive()
{
return true;
}
}
HttpClient simpleHttpConstructor()
{
return new HttpClient;
}
Methods and functions paremeters are camelCase. Example:
class HttpClient
{
public void post(const(char)[] postContentVariable)
{
}
}
void simplePost(const(char)[] againVariable)
{
}
Above are cascalCase. Example:
class HttpClient
{
public HttpHeaders responseHeaders;
public HttpHeaders getResponseHeaders() @property
{
return responseHeaders;
}
}
Are camelCase. Example:
class HttpClient
{
private bool isConneted;
private bool checkIfConnected() @property
{
return isConnected;
}
}
Are camelCase. Example:
void foo()
{
string myLocalScopeVariable;
}
Are not allowed. Also try to make variables and functions names verbose Example:
Correct:
obj.OnOkButtonClicked = void delegate() {};
Bad:
obj.OnOkBtnClkd = void delegate() {};
We stick to Allman style aka ANSI Style. No exceptions to this rule. Tab width: 4 spaces, we use spaces instead of tabs.