(no subject)

Nov 07, 2006 00:49



I was in a class at Microsoft a few weeks back and the teacher told a little anecdote about colleagues who insist on certain coding conventions and the clashes that result from them. He told us that one time, during a group code review, a tester got so vehement about the allegedly illegible code a dev wrote that he approached him almost threateningly, and the teacher thought it was going to become a shoving match. The matter at hand, of course, was the age-old battle of the curly brace. For those of you who think this is a petty matter, try to debug a block of code with a ton of nested loops that are coded in the style you're not used to. The teacher wrote the following block of code on the whiteboard:

for (int i = 0; i < 10; i++) {
   ...
}

The amusing part is that about 80% of the class boo'ed at this point. More than just boo'ed, some people (okay, me included) were like 'Aw come on!' Then he put up this pristine piece of legible code:

for (int i = 0; i < 10; i++)
{
   ...
}

At which point, as you could probably guess, half of the room applauded! Yes, applauded. (I guess those supporting the first style chose not to voice their minority opinion) At that moment, I felt a really stupid nerdy bond with the stalwart 80% of the people in the room. I never really realized how such a meaningless point of convention can be so polarizing among software engineers.

So the natural question for you guys is... if you program, which style is your preferred? Don't be bashful if you prefer the first method... I'm tolerant of other lifestyles. I vote Democrat.
Previous post Next post
Up