The D Style and tab sizes

Steve Horne stephenwantshornenospam100 at aol.com
Mon Sep 11 06:02:28 PDT 2006


On Sun, 10 Sep 2006 17:03:39 -0700, Walter Bright
<newshound at digitalmars.com> wrote:

>What if you want to write:
>
>	foo();	// comment
>		// more comment
>
>and have the comments line up?

Yes - among other vertical alignment issues, like large parameter
lists. If I have a large expression, I'll probably use vertical
alignment to emphasise the structure...

  varname = (   blahblahblah
             op (   blahblah
                 op blah
                )
            );

Could split it into multiple statements, but IMO this is usually
clearer, as long as there's no repeated subexpressions.

Actually, Haskell even makes a similar vertical alignment style part
of the language - it's called the 'offside rule' and it reduces the
need for parentheses.

-- 
Remove 'wants' and 'nospam' from e-mail.



More information about the Digitalmars-d mailing list