Introducing 

Prezi AI.

Your new presentation assistant.

Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.

Loading…
Transcript

Thank You

use PascalCasing for class names and method names.

avoid using Abbreviations. Exceptions: abbreviations commonly used as names, such as Id, Xml, Ftp, Uri

do not use Screaming Caps for constants or readonly variables

public class DirectCost

{

public void DirectCost()

{

//...

}

public void DirectCost()

{

//...

}

}

// Correct

UserGroup userGroup;

Assignment employeeAssignment;

// Avoid

UserGroup usrGrp;

Assignment empAssignment;

// Exceptions

CustomerId customerId;

XmlDocument xmlDocument;

FtpHelper ftpHelper;

UriPart uriPart;

// Correct

public static const string ShippingType = "DropShip";

// Avoid

public static const string SHIPPINGTYPE = "DropShip";

  • use noun or noun phrases to name a class.
  • prefix interfaces with the letter I.
  • organize namespaces with a clearly defined structure.
  • vertically align curly brackets.
  • declare all member variables at the top of a class, with static variables at the very top.

do not use Hungarian notation or any other type identification in identifiers

Pascal Casing and Camel Casing.

do use predefined type names

instead of system type names like

Int16, Single, UInt64, etc

// Correct

int counter;

string name;

// Avoid

int iCounter;

string strName;

do use PascalCasing for abbreviations 3 characters or more (2 chars are both uppercase)

// Correct

string firstName;

int lastIndex;

bool isSaved;

// Avoid

String firstName;

Int32 lastIndex;

Boolean isSaved;

Pascal Casing:

e.g. PascalCasing.

Camel Casing:

e.g. camelCasing.

e.g.

HtmlHelper htmlHelper;

FtpTransfer ftpTransfer;

UIControl uiControl;

Coding Standards

and

Naming Conventions

use camelCasing for method arguments and local variables.

do not use Underscores in identifiers. Exception: you can prefix private static variables with an underscore.

public class UserLog

{

public void Add(LogEvent logEvent)

{

int itemCount = logEvent.Items.Count;

// ...

}

}

// Correct

public DateTime clientAppointment;

public TimeSpan timeLeft;

// Avoid

public DateTime client_Appointment;

public TimeSpan time_Left;

// Exception

private DateTime _registrationDate;

By: Asif Bhat

Software Developer

BIT Group Sdn. Bhd.

Learn more about creating dynamic, engaging presentations with Prezi