Programming Style Guidelines
The following code samples look exactly the same in the eyes of the Java compiler:
Code sample 1: while (v1 > v2 + 3) v1=v1+1;
Code sample 2: while (v1 > (v2 + 3))
{
v1=v1+1;
}
Code sample 3: while (v1 > (v2 + 3)) {
v1++;
}
So which style is best? The answer is that every organization adopts a certain style and sticks to it. And, in this course, we use the Programming Style Guidelines written by Boaz Kantor. To avoid losing points in your submitted exercises, make sure that your Java code follows these guidelines.You can also use this version, which is the same as the above only without examples, which is much shorter.
Code sample 1: while (v1 > v2 + 3) v1=v1+1;
Code sample 2: while (v1 > (v2 + 3))
{
v1=v1+1;
}
Code sample 3: while (v1 > (v2 + 3)) {
v1++;
}
So which style is best? The answer is that every organization adopts a certain style and sticks to it. And, in this course, we use the Programming Style Guidelines written by Boaz Kantor. To avoid losing points in your submitted exercises, make sure that your Java code follows these guidelines.You can also use this version, which is the same as the above only without examples, which is much shorter.