November 2022

S M T W T F S
  123 45
6789101112
13141516171819
20212223242526
27282930   

Style Credit

Expand Cut Tags

No cut tags
Saturday, September 26th, 2009 12:07 am
Want to spark a religious debate amongst software developers? Which is the one true faith?
// Choice 1
if (condition) {
    // statements
}
else {
    // statements
}

// Choice 2
if (condition)
{
    // statements
}
else
{
    // statements
}
The only reason wars have not been fought over this is that war is so inefficient.

I had to review some code prior to a change and I looked at the history of the file in Source Safe before checking it out. It read like a history of hostilities between two sides of a hot religious or political debate. One person would use the first method above, the next would use the second. Some people indent by 2, others by 3, 4 or 5 spaces. Some always use // to comment, others always use /* */. Some use tabs to indent while others use spaces.

I, of course, adhere to the oldest, truest faith: I tailor my new code to match that of the code around it. That way, no one can blame me when the inevitable Code Wars break out.

Well, except for that tab/spaces thing. Clearly, coders who use spaces to indent are heretics and destined for coding hell: being frozen for 8000 years only to be revived to modify COBOL programs to be Y10K compliant. I've been known to convert all mutli-space indents to tabs before checking code into source control.

I mean, come on. There's heresy and then there's insanity.

Reply

This account has disabled anonymous posting.
(will be screened if not validated)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting