What coding standards do you follow?
- by Mark Szymanski
I was just curious what coding standards people followed.
I for one use the following:
Brackets ALWAYS go on the next line. For instance:
int main()
{
//Blah...
}
I never use code folding. (Yes my IDE's do support it (Xcode and Eclipse).
Put related functions/methods single-spaced, otherwise double space. Here is an example:
int foo = 0;
printf("%d",foo);
those are related while these are not:
printf("Hello, World!");
return(0);
I don't put else statements on the same line as the closing bracket for the preceding if statement.
Most of the time in Java if a program needs multiple try catch statements I will just put the whole thing in one try catch.