The allman style is named after eric allman.
Allman style vs k&r. Web this is a survey of well known software projects and companies and their chosen brace and indent style. } // ansi syntax int foo (int a, char *p) { return 0; Web the problem for me is that i've grown rather fond of the allman style and would rather not change.
#474 (comment) in fact i wouldn't mind going a step further, and just adopting google's java style guide: Web allman style, whitesmiths style, and k&r (unix kernel) style are probably your best bets out of the 5 options considered. Web i've always felt the allman style makes code look cleaner, beautiful, and easier to read by enabling clear alignment of code blocks.
The indentation is also obviously consistent, making this style more clear than gnu style. However, the 2003 edition now uses allman style throughout. In recent version of visual studio (at least 2017):
Allman braces just add work to prs. This might be a trivial issue for some, but my point is that coding style should not be enforced by the compiler. However i would argue that we should switch to k&r because it's what the vast majority of java devs use.
Stroustrup (see above) is an interesting variant of k&r, with slightly better readability. Share improve this answer follow edited jul 3, 2019 at 13:54 This style was first introduced by kernighan and ritchie’s book the c programming language.
Web i think it's not a bad idea to mix allman and k&r style. Web this style combines the advantages of allman by keeping the vertical alignment of the braces for readability, and identifying blocks easily, with the saving of a line of the k&r style. Web k&r syntax is obsolete, you can skip it unless you have to maintain very old code.