What Are Styling Conventions?
When there are several ways to do the same thing, everybody acts differently.
Programming languages provide leeway and allow writing the exact same command in different ways.
For example, the following commands are exactly the same in the eyes of the compiler:
while (v1 > v2 + 3) v1=v1+1;
while (v1 > (v2 + 3))
{
v1=v1+1;
}
while (v1 > (v2 + 3)) {
v1++;
}
Styling conventions, like most conventions, provide uniformity of code. Reading the code of different programmers does not require adapting, and since most of the time we'll be maintaining code, this saves a lot of time (and anger).
Programming languages provide leeway and allow writing the exact same command in different ways.
For example, the following commands are exactly the same in the eyes of the compiler:
while (v1 > v2 + 3) v1=v1+1;
while (v1 > (v2 + 3))
{
v1=v1+1;
}
while (v1 > (v2 + 3)) {
v1++;
}
Styling conventions, like most conventions, provide uniformity of code. Reading the code of different programmers does not require adapting, and since most of the time we'll be maintaining code, this saves a lot of time (and anger).
Our Course Conventions
Sun Microsystems have written general guidelines for style conventions. We tend to conform to their styling conventions, so you should adhere to their document. The document can be found here.