Want to spark a religious debate amongst software developers? Which is the one true faith?
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.
// Choice 1The only reason wars have not been fought over this is that war is so inefficient.
if (condition) {
// statements
}
else {
// statements
}
// Choice 2
if (condition)
{
// statements
}
else
{
// statements
}
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.