Archive | August, 2009

02 August 2009 ~ 28 Comments

If-else vs switch – Which is better?

“Use switch instead of if-else, its more readable and has better performance.” I have to admit that this was one of my favorite code review comment. Until one fine day, while hacking Apache Sanselan’s image format decoding function, I tried optimizing the code based on the same comments and while benchmark there was hardly any [...]

Continue Reading