April 2017
Beginner to intermediate
394 pages
9h 16m
English
Block statements such as loops and conditionals should have the sub statements indented. This easily shows the program intent to the reader. The number of spaces to indent is less important than the indentation itself. Most programmers agree that 2 to 4 spaces are sufficient for readability. The most important thing is to be consistent with your spacing. Likewise, the placement of the starting curly brace isn't important, (although you can find some interesting arguments online), but it is important to consistently place it in the same location:
//This shows the purpose of the statement if (s_isFullScreen) { s_style = FULLSCREEN_STYLE; SetFullScreen(true); } //So does this if (s_isFullScreen) { s_style = FULLSCREEN_STYLE; ...Read now
Unlock full access