Well I haven’t posted in a while, and I don’t really have much to talk about. So I decided I’d comment on something that most of you won’t care about (I used to think only about two people read my blog but apparently there are more because I’ll get an occasional IM commenting on something I said right here).
So what I’m discussing today is that I have recently changed my coding style on if-blocks. This is how I used to do it:
1 2 3 4 5 6 7 8
if (condition) {
statement;
statement;
}
else {
statement;
statement;
}
After maintaining enough code written that way, I’ve decided that the following format is much easier for the person who comes back and has to decipher your code:
1 2 3 4 5 6 7 8 9 10
if (condition)
{
statement;
statement;
}
else
{
statement;
statement;
}
PS: I hate it when people use tabs instead of spaces to indent their code.