[OT] Auto code reformating / one coding style enforcment.

Sean Kelly sean at f4.ca
Mon Aug 14 18:23:27 PDT 2006


Regan Heath wrote:
> 
> Oh, and for those who want to align text on seperate lines remember the 
> golden rule; "hard tabs first, spaces following" and you'll have no 
> problems. Regardless of the viewers tab width the lines will align. 
> (ignoring non fixed-width fonts, for which no solution involving 
> spaces/tabs will work).

What about:

     int x,
         y,
         z;

     if( x == y ||
         y == z )
     {
         func( x,
               y,
               z );
     }

Changing tab widths can totally mess up this sort of thing if tabs were 
involved in the creation of any of the involved lines.  Things get even 
worse if some lines were indented with spaces and others with tabs. 
I'll admit that none if this is a problem for solo projects, but in a 
group it can be a disaster.  And maybe you can enforce indenting rules 
to this level of detail, but I can't :-)


Sean



More information about the Digitalmars-d mailing list