#C coding style
25-Jul-89 01:09:46
Sb: #58642-#C coding style
Fm: Don Curtis/SYSOP 76703,4321
To: Richard Rae/SYSOP 76703,4253
Rick,
By using the larger indents (but not 8 chars…I use 5), the block
structure becomes very clear (to me) and the "look up rule" where the closing
brace is on the same level as the opening statement makes it clear (again to
me) where the block starts and ends.
Yes, the opening brace can get "lost" visualy if you've got a comment
on the same line like this:
if (something) { /* comment here "hides" the open brace */
foo();
bar();
baz(); /* comments here hide nothing */
} /* hopefully obvious close of the "if" */
But even with the visual losing of the open brace, the block structure
of the code enforced by the indents should make it clear what comprises the
block and by looking up in the same column as the close, it should also be
obvious that I'm closing the "if".
But again, it is all what you're used to. I prefer this style because
it's the way I learned, and it seems intuitive to me. If you and Chris can
live with each other…fine. That's all that's important..that each of you can
read the other's code.
Don