Skip to content

Latest commit

 

History

History
146 lines (116 loc) · 2.04 KB

NamingConvention.md

File metadata and controls

146 lines (116 loc) · 2.04 KB

Naming Convention: Overview

We would like to stick to .NET naming convention, which involes:

Classes and Structs

Classes and Structs are PascalCase. Example:

class HttpClient
{
 	
}

struct HttpHeader
{
 
}

Enums

Enumerations are PascalCase, same goes for their members Example:

enum HttpVersion
{
    OnePointZero,
    OnePointOne,
}

Methods and functions

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 parameters

Methods and functions paremeters are camelCase. Example:

class HttpClient
{
 	public void post(const(char)[] postContentVariable)
 	{
 	
 	}
}
 
void simplePost(const(char)[] againVariable)
{
 
}

Public class/structs members and public @property

Above are cascalCase. Example:

class HttpClient
{
 	public HttpHeaders responseHeaders;
 	
 	public HttpHeaders getResponseHeaders() @property
 	{
 		return responseHeaders;
 	}
}

Private class/structs members and private @property

Are camelCase. Example:

class HttpClient
{
 	private bool isConneted;
 	
 	private bool checkIfConnected() @property
 	{
 		return isConnected;
 	}
}

Local scope variables

Are camelCase. Example:

void foo()
{
 	string myLocalScopeVariable;
}

Hungarian Notations

Are not allowed. Also try to make variables and functions names verbose Example:

Correct:

obj.OnOkButtonClicked = void delegate() {};

Bad:

obj.OnOkBtnClkd = void delegate() {};

Indendt Style: Overview

We stick to Allman style aka ANSI Style. No exceptions to this rule. Tab width: 4 spaces, we use spaces instead of tabs.