June 2025
Intermediate to advanced
1093 pages
33h 24m
English
Whether you place the curly brackets on the line with if and for or on the next line and then indent the brackets again or not is another question of taste and agreement within the team. One possible way to do it is this:
Opening parenthesis to the line with the keyword
Indent bracketed block
Closing bracket back to indentation depth with the keyword
Also surround single statements with brackets
For round parentheses (...) there are similar differences: Do you use a space after the if or for or the parenthesis directly after it? Are parentheses always surrounded by spaces, even after opening and before closing? A possible convention would be as follows:
Space neither before nor after the opening parenthesis ...
Read now
Unlock full access