|
That is only a problem if you put the single statement on a new line. When I do that, I always add the braces from the beginning, but if the single statement is simple and short, such as a simple value assignment (if (fruitType == banana) color = yellow;), it all goes on one line. If you add another statement to this 'if' claues, you move the first assignment down and add the braces.
Never an indent without a brace on the line above!
|
|
|
|
|
but it depends on the situation.
|
|
|
|