[prog] C and curly braces - question of style?

Jenn Vesperman jenn at anthill.echidna.id.au
Mon Aug 23 15:52:06 EST 2004


On Mon, 2004-08-23 at 11:10, Jacinta Richardson wrote:

> But as someone else has said, whichever you choose *be consistent*.  In 
> particular use a consistent indent level.  One tab, or x many spaces... 
> Don't indent in some places and not in others.

I prefer that people indent using tabs, not spaces. If you want a
narrower tab level than is standard, set it in your editor.

Why?

Because this way, when Someone Else is reading your code in their
editor, the indent level is set to what is easy for them to read, all
automagically! 

If you mix tabs and spaces, however, that indentation magic breaks as
soon as you find someone with a different tab depth. They (or you) get
horribly mis-indented code. So always use tabs or spaces, NOT both. And
of the two, I recommend tabs.


Jenn V.
-- 
    "Do you ever wonder if there's a whole section of geek culture 
        	you miss out on by being a geek?" - Dancer.
   My book 'Essential CVS': published by O'Reilly in June 2003.
jenn at anthill.echidna.id.au     http://anthill.echidna.id.au/~jenn/




More information about the Programming mailing list