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

Katie Bechtold katie at katie-and-rob.org
Sun Aug 22 18:52:16 EST 2004


On Sun, Aug 22, 2004 at 06:28:39PM -0400, aec wrote:
> I have recently begun what is looking like a long
> and difficult journey into learning C. 

Good luck!  It's a useful language to know.

> I am told my "style" of using curly braces {} in loops
> is not generally the best way to do it.

Your style coincides with the official C coding standard at my
workplace.  I think the choice of curly-brace placement is entirely
a matter of personal taste, and your choice is one of several
accepted coding styles.  

> any thoughts? or should i just worry about more important things :)

I'd say just worry about more important things.  Yes, you should
comment your code for easier reading.  Yes, you should indent your
code and use whitespace liberally.  But, in my experience, there is
no consensus on the best curly-brace style, and it isn't worth
worrying (or arguing) about.

-- 
Katie Bechtold         http://katie-and-rob.org/




More information about the Programming mailing list