You are on page 1of 2

Naming Conventions and Indentation

- inorder to write clean and maintaintable code


naming convention and Indentation is mandatory

Naming Coventions

Identifiers
- User defined names
e.g. variable,class, structure, label, function

1-Class Naming

class MirzaFraz {

};
class Car{ ...}
Class Owner { ...}
class ShoaibFarooq{...}
class UCP {....}

2- Functions naming
void mirzaSarfraz(){...}
void car() { }
void getId(){}
void getName() { }
void setName() {}
void set() {}
3- Variable Naming
same as functions
int mirzaSarfraz;
int a;
int apple;
int appleJam;
int setName;
4- Constants
All Upper

const int MIRZAFRAZ=10;


CONST int A=10;

5- Structures
same as classes
................................................

Indentation

- Class

class Car{

};

if (a>b){
x=10;
x=20;
}

while (a>n){

dsddd

if (a>b){
.....
...
} else {
,,,,
.....
}

You might also like