Commit d9e397dc authored by Andinet enquobahrie's avatar Andinet enquobahrie

ENH: Add layout coding style

parent c5874378
......@@ -64,7 +64,48 @@ git pull origin master
------
### Coding style
*Coming soon - Please refer to the rest of the code in the meantime*
#### Layout
1. Do not use tabs. Set up your editor to insert spaces. Indentation size should be set to 4.
2. Braces must be used to delimit the scope of an if, for, while, switch or other control structure.
3. Curly braces should go on a seperate line.
```sh
for(unsigned int i=0; i < 3; i++)
Please register or sign in to reply
{
...
}
if( condition )
Please register or sign in to reply
{
...
}
else if( other condition)
Please register or sign in to reply
{
...
}
else
{
...
}
```
3. Source code in the body of the brackets must be indented
Please register or sign in to reply
```sh
for(unsigned int i=0; i < 3; i++)
Please register or sign in to reply
{
int z;
z = i + 4;
}
```
4. Each line of code should take no more than 200 characters
4. Use lots of whitespace to separate logical blocks of code
5. Declaration of variables within classes, methods, and functions should be one declaration per line
```sh
int i;
int j;
char* stringname;
```
### Documenting your code
*Coming soon - Please refer to the rest of the code in the meantime*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment