Quote:
Originally Posted by Zuuljin Eclipse might be a little too good for beginners. Its auto-pilot for alot of stuff. I'd say if your just learning, stick with the text-editor or any basic interface until you know whats going on.
To answer your question (even though its already been answered, but I thought i'd contribute), spaces/tabs/blank lines is all preference and is not enforced in the code at all. The compiler completely ignores it all. The reason for spacing is readability. Generally, the /tab thing is the most important, and everything else is user preference, such as some people like putting the { directly after a method such as Code: myMethod() {
//stuff
} instead of on the next line as in Code: myMethod()
{
//stuff
} I prefer the latter as it seems to frame the code better, but noone will yell at you for doing it the other way. |
I agree with the above with one restriction and thats try/catch blocks. For some reason I put the curley on the next line except for try/catch. If I just want to print out the exception and excape the method I'll do that in a single line such as:
Code:
try{
MyCode
}catch(Exception e){e.printStackTrace();return;}
This comes into play alot when doing database programming where you have to wrap alot of things in try/catch blocks. Just saves alot of space. Because you should really test your data and avoid try/catch via good programming ideas. I don't think I use try/catch outside of File IO and database programming.
Seems like this thread is degenerating into "these are my programming conventions" now though