Henooh Coding Guidelines

Do and Don't - Coding Guidelines

Coding guidelines are similar to style guidelines that the end results are same. Unlike style guidelines, coding guidelines are based on better practices - that a more novice developers are likely to use less optimal practices. Most code guidelines are applicable to all software development in Henooh Framework.

String Data Type

Do use the + operator to concatenate short strings.

string displayName = data.LastName + ", " + data.FirstName;

Do use a StringBuilder object When appending string in loops in large amount of text.

string phrase = "na na na na ";
StringBuilder manyPhrases = new StringBuilder();
for (int i = 0; i < 10000; i++)
{
    manyPhrases.Append(phrase);
}

Don't use the + operator to append large amount of text.

string phrase = "na na na na ";
for (int i = 0; i < 10000; i++)
{
    phase += phase;
}

Data structure and arrays.

Do use List and Dictionary. (Generic Types)

public class Blob
{
    public List Coordinates { get; set; }
}

Don't use array or ArrayList. Ofcourse, exceptions do exist.

public class Blob
{
    public Point[] Coordinates;
}

Error Handling.

Operators to use Guidelines.

Object Oriented Practices.

.