indent style for D

Ali Çehreli acehreli at yahoo.com
Sun Jan 29 09:19:12 PST 2012


On 01/29/2012 06:54 AM, Trass3r wrote:
>> Personally, I've never understood how anyone can stand anything other
>> than Allman.
>
> Totally agree.

Well, people adapt and values change. :)

I've always used Allman style (although learning its name just now), 
until I started to work at my current job more than 4 years ago. We use 
a modified 1TBS by adding an extra empty line before the else:

     if (x < 0) {
         puts("Negative");
         negative(x);
                                  // <-- added
     } else {
         puts("Non-negative");
         nonnegative(x);
     }

I know there isn't one perfect style, but to me, that's the most 
recognizable one. Of course I can rationalize it too. :)

Ali


More information about the Digitalmars-d mailing list