I hate K&R Bracketing, but I have a guess as to where it came from. Not all languages have a "begin" construct (only "end"), and so putting the starting brace on the same line as the comparison makes the code look a similar style. Althouth why Ritchie specifically felt this was necessary is beyond me, since if he wanted a language without a "begin" construct he could have just left the beginning brace out when he creatd the thing. Of course, I might be wrong on why they used that style- I'm just speculating.

Personally I think I could probably learn to work in K&R, but I would be pretty unhappy for a while. It just seems fundamentally wrong not to match braces up visually.

Interestingly enough, on the thedailywtf forum yesterday there was someone ranting against standard bracing, complaining that the extra white space (the line with the starting brace) was useless and made the code difficult to read. Whatever.

I think I read somewhere that Steve Mcconnell said there is no room for religion in programming (his dad was a preacher, btw), and I think he's right. There are certainly a lot of wrong ways to do things, but there is no single "one right way" to solve problems or write code, and when people start talking that way (I'm thinking specifically of managers), then I start worrying. Mcconnell even makes a case that using the *very* occassional goto could be considered OK if the need is warranted, saying that the old standard "never use gotos" is a bit to hard line*. He does a good job arguing this in "code complete", especially with some of his "rewrite this without a goto" examples, though I must admit to having been in the "never use gotos" camp forever and not having ever had need of one. Still, I think the overarching point is valid. Programming principles are important, but when it comes to specific implementation leave religion out and be accepting of other people's choices, even if they are different from your own . . . unless it's just plain 'ol bad code.

*What Mcconnell says about gotos is, as a rule of thumb try not to use them, and if you do you can get rid of 90% fairly easily. Once you are down to the 10% where gotos seem necessary, work very hard to get rid of 90%. When you've done that, you may have a legitimate need for the reamaining goto.
_________________________
-Jeff
Rome did not create a great empire by having meetings; they did it by killing all those who opposed them.