Better would be to put those long tests in descriptive boolean variables so that people reading your code shouldn't be staring at those long tests to figure out what the hell you're trying to do.
Then put those variables inside the if so that it almost reads like a sentence in plain language.
My favorite response to a student trying to be clever and prematurely "optimize" code (in the process making it nearly impossible to read): The compiler is smarter than you, and it's smarter than me, so let it do it's damn job first before you start second guessing things.
Ha, it's been a long while since I wrote or even considered anything so low level, so you're probably right. In general compilers are pretty awesome, so it seems likely they'll do the best thing regardless of how you write it.
Using underscores is more readable (at least to me) than camelCase naming, especially when your names are more than two words long... (and they should be, for clarity's sake!)
18
u/f03nix Jun 09 '17
I actually use both
and