posted 13 years ago
Hello all,
A code formatting question where I cannot derive to 'when to' and 'when not to' from the style guide..
I fear I am in breach of some formatting rules when it comes to using my braces and indenting. Now, reading the style guide it recommends an indentation of 4 spaces but where it is not clear is when to indent. Using the example below, I start with the class definition, open my braces and then indent 4 spaces for my method.I have then indented for the if and so on as I go along, matching the closing braces up with the opening one. My question is wen to indent as I fear I'm doing too much indentation- Any hard and fast rules such as always indent after class name? Always for method etc..Basically..when should a next line line up with the brace before and when should an indent be used?
Thanks,
Colm