Coding Standard - rimi303/SoftwareEngineeringProject GitHub Wiki

Identifier Naming and Capitalization :

You should use PascalCase for all declarations and names except loop counter variable.

●Use descriptive and meaningful names for all Variables, Function names, Constants, and other Identifiers and these Names start with Uppercase letter and for descriptive meaningful Name it should be PascalCasing.

●Use single letter identifiers only for the counter in loops and only it should be in lowercase.

●Class and Interface names start with an uppercase letter and indentation should be like this. When use interface class name should be IBookshop.

Example:

class Student

{

 //... 

}

interface IBookshop

{

 //.....

}

abstract class AUser

{

 //...

}

●Variable names start with Capital letter and also for descriptive name it should be in PascalCasing.

Example:

int Sum;

String UserPassword;

● Also, Constant Name will start with Uppercase, but meaningful one.

like:

int ConstantName;

●Method names start with a Uppercase letter.

Example :

private int Function(Int Num1)

{

}

●Multi-word identifiers are following PascalCasing.

Example :

int SumOfNumbers;

●Do not use hyphens or underscores to separate multi-word identifiers, use PascalCasing always.

Spacing Between lines :

Separate each method within a class definition. Use one blank line to separate logical sections of code use two blank lines to separate within a method.

Example :

For Built in method follow the indentation like:

public static void main (String[] Arguement) {

      System.out.println("Hello"  +  "  "  +  "World");                                 

}

For User define method follow the indentation like:

public void FunctionSum()

{

 // ...

}

Spacing Within lines :

●Put a single space before "{" when required.

●Separate all binary operators, such as "+", "-", "*", "/", "%", "==", "=" etc., with a single space.

The exception is unary operators, such as "++", "--", unary minus "--", etc, which need not to be separated with a single space.

Indentation :

● Indent two spaces when beginning a new block.