Date: Thu, 15 Jun 1995 20:02:23 -0400 From: dj (DJ Delorie) To: junaid AT barney DOT eng DOT monash DOT edu DOT au Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: CODING STANDARDS: A GUIDE > 2. Conditionals > > if (condition) { > ... > } > > if (condition1 || condition2) { > } else { > } > > if (foo && !bar) { > } else if (bletch) { > } This syntax really bugs me and makes it harder for me to read the code. I prefer this way: if (condition) { ... } if (condition1 || condition2) { ... } else { ... } if (foo && !bar) { ... } else if (bletch) { ... } The rule being that matching braces are always in the same column, and nothing else is ever on the line with them. This makes it easier to find matching braces visually and adds whitespace that makes the code easier to deal with. Note that I prefer two-space indents rather than tabs, as code tends to wander off the right side of the screen too fast with tabs. DJ