CompuServe Messages

#PrettyPrint.c

    10-Jan-88 20:11:40
Sb: #102578-#PrettyPrint.c
Fm: Ben Blish 72667,1341
To: Richard Rae/SYSOP 76703,4253
Since we're all doing this <grin> and since I started the thread, I wanted to put in my 2 pfennigs on this. I want to show how we write our source here (not the rotal we, the company we), and why. Here's a code fragment: int oTheFuture(with,me) BYTE with,*me; { int oTrouble; BYTE it; it = with; for (; it < *me; it++) { switch(with) { case CLOSED: { DoGoodStuff(it); break; } case THEJOINT: { LookAround(with,*me); DoGoodStuff(it); break; } default: { ForCloseOn(it); break; } } } return((int)with+(*me)); } – Now – the reason for all the brackets, and the indentation; because you can look at the code as you write it and immediatly determine two important things. First (like any other good indent style) you can tell if code is in the the right atomic group; second, and this is unique to this style, you can tell if you've missed a brace anywhere; because code exists ONLY every 8 char positions – and braces too – only THEY show up on a set of 8 that is four off from the code; If code shows up at a brace level, You Screwed Up! Continued –