When comparing (Linux) Kernel Style vs Whitesmiths style, the Slant community recommends Whitesmiths style for most people. In the question“What is the best indentation style in C?” Whitesmiths style is ranked 3rd while (Linux) Kernel Style is ranked 5th. The most important reason people chose Whitesmiths style is:
Like the Allman style, with the Witesmiths style the blocks are clearly set apart from the control statements.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Easier to define where a block starts and ends
The large indentation suggested by this style makes it easier to define where a block of code starts and where it ends. Especially after looking at a screen for a prolonged amount of time.
Pro Blocks are set apart from control statements
Like the Allman style, with the Witesmiths style the blocks are clearly set apart from the control statements.
Pro Indenting the braces makes them feel that they are subordinate to the control statement
Indenting the braces makes them feel that they are subordinate to the control statements. Which helps the reader understand which block belongs to which control statement.
Pro Easy to see how blocks of code belong together.
The fact that the code lines up up with the braces makes this by far and away the easiest style to read. The code flows much more naturally, there is zero doubt about which block the codes belongs to, your eyes are quickly drawn to what belongs where.
Pro Makes a clear divider on multi line control statements
Sometimes a control statement can take a lot of arguments and go over many lines. It frees your mind from doing the work to separate arguments and code block.
Pro Indenting Braces removes noise from the vertical line
When scanning vertically through large sections of code to review the code execution flow, having the braces indented means less noise to filter out. The execution flow statements stand alone on the vertical line and are thus far more quickly picked out by the eye.
Cons
Con Hard to read in small monitors
Since the Kernel style uses 8 characters for indentation, the lines of code are pushed too much to the right. This may make it harder to read for small monitors (for example terminal monitors which are 80 characters wide).
Con May be confusing to the eye
The braces confuse the focus of the reader's eye and this causes the reader to look longer at the line right after the opening brace and at the line right before the closing brace.
Con The closing brace does not line up with the corresponding statement
The closing brace does not line up with the statement it belongs to.