views:

351

answers:

4
+1  Q: 

Indent style names

I've seen this questions here. I'm wondering if there exists an offical 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 statments within are indented and the closing brace is on the same identation level as the control statement, the style is called K&R-Style. So is there a name for the ident style for the this code sample above?

+8  A: 

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

Jesse Pepper
+1  A: 

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++.

Eli Bendersky
A: 

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

Max
KNF use 8 space wide hard tabs, Allman/ANSI uses 4 space wide soft tabs (spaces).
Joe D
A: 

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

PEZ
Or LIS - Legibility Improving Style.
Vilx-