On Mon, 10 Nov 2014 14:00:32 -0800
"H. S. Teoh via Digitalmars-d-learn"
<digitalmars-d-learn@puremagic.com> wrote:

> I used to be an Egyptian-braces / tabs-only-indentation advocate. That
> works reasonably well in C/C++, but I find that with idiomatic D, Phobos
> style actually works much better. (Well, except that horrid camelCasing,
> but hey, you can't win every battle.)  D code tends to require many more
> levels of indentation than C/C++, so using tabs can be quite cumbersome.
> also, Egyptian braces tend to work better when the leading line of
> nested blocks is simple, but in D, esp. with the complexity of function
> declarations, the opposite is true.
i HATE tabs. i hate tabs so much that all of my scripting languages
considers tab character as fatal syntax error.

> But at least none of us use the following bracing style, which I had the
> misfortune of coming across many years ago (I kid you not, people
> actually exist who write code like this):
> 
>       int my_func(int arg) {
>               if (arg==1) {
>                       printf("One\n");
>                       }
>               else {
>                       printf("Not one\n");
>                       }
>               for (i=0; i<10; i++) {
>                       int x = i*2;
>                       do_something_else(x);
>                       }
>               }
> 
> I think I needed therapy after encountering this. :-P
please, make me unsee that!

Attachment: signature.asc
Description: PGP signature

Reply via email to