What is the name of this particular indent style? ("braces stacked")
Asked Answered
R

4

6

I've seen this questions here. I'm wondering if there exists an official name for the following indent style:

void fooBar(String s)
{
    while (true)
    {
        // ... do something
    }
}

When the opening brace is in the same line as the control statement, the statements within are indented and the closing brace is on the same indentation level as the control statement, the style is called K&R-Style. So is there a name for the indent style for the this code sample above?

Ringed answered 3/1, 2009 at 9:43 Comment(2)
I'm not quite sure that the description you gave matches up to the example code.Genetic
The description talks about K&R-style (or "the only sane bracketing scheme" if you ask me)Nether
I
13

Allman style (bsd in Emacs) see wikipedia article http://en.wikipedia.org/wiki/Indent_style

Inflated answered 3/1, 2009 at 9:47 Comment(0)
M
3

Yep, this is the ANSI style, called this way because it appears in the ANSI C documents. The popular auto-formatting util astyle refers to it as ansi

AFAIK, It's also the one used by default in Visual C++.

Muggy answered 3/1, 2009 at 9:49 Comment(0)
M
-1

It's called KNF or Kernel Normal Form. More information can be found in man 9 style.

Master answered 3/1, 2009 at 9:43 Comment(1)
KNF use 8 space wide hard tabs, Allman/ANSI uses 4 space wide soft tabs (spaces).Stevestevedore
N
-7

It should be named WSRE (Waste of Screen Real Estate).

Nether answered 3/1, 2009 at 11:37 Comment(1)
Or LIS - Legibility Improving Style.Aguish

© 2022 - 2024 — McMap. All rights reserved.