Horstmann Style
The 1997 edition of Computing Concepts with C++ Essentials by Cay S. Horstmann adapts Allman by placing the first statement of a block on the same line as the opening brace.
while (x == y) { something; somethingelse; //... if (x < 0) { printf("Negative"); negative(x); } else { printf("Non-negative"); nonnegative(x); } } finalthing;This style combines the advantages of Allman by keeping the vertical alignment of the braces for readability and easy identification of blocks, with the saving of a line of the K&R style. However the 2003 edition now uses Allman style throughout.
Read more about this topic: Indent Style
Famous quotes containing the word style:
“The authoritarian child-rearing style so often found in working-class families stems in part from the fact that parents see around them so many young people whose lives are touched by the pain and delinquency that so often accompanies a life of poverty. Therefore, these parents live in fear for their childrens futurefear that theyll lose control, that the children will wind up on the streets or, worse yet, in jail.”
—Lillian Breslow Rubin (20th century)