I said I hated the code on http://imgur.com/gallery/ZM0lYhb/ and StillNotYouTube asked for a better explanation. So here it is
if (foo == bar) {
return "foo is bar";
} else {
return "foo is not bar";
}
Is bad form. I would like:
if (foo == bar) {
return "foo is bar";
}
return "foo is not bar";
There's several reasons for this is better For example, in the first code example I have to worry what the routine returns after the if/else (i.e. I actually have to work out it's unreachable and that I shouldn't worry about that)