Code Style

Georg Wrede georg at nospam.org
Fri Jun 15 19:18:17 PDT 2007


Robert Fraser wrote:
> 
> Right now, I'm working on a code formatter...
> 
> So, what style do you code with (I know I'm not going to get a consensus...

I read the replies so far. All seemed to be reasonable and expected.


For myself, I have another wish:

I have to use two separate styles for coding. One for what I'm really 
doing, and another one for {publishing/lectures/review examples}.

((
Example, normally I'd write:

int foo(int a)
{
    return a + 2;
}

but when pressed for space (as on an overhead, or a text book), I'd write

int foo(int a) {
   return a + 2;
}

Here the difference doesn't seem grand, but imagine fifty lines of code, 
either it takes a page, or two, depending on style. More dead trees.
))

So, my wish is that you could have two separate styles stored.



More information about the Digitalmars-d mailing list