Geeks With Blogs
Phubar Baz Musings of an HTML5 Programmer July 2011 Entries
Performant Conditional Statements
I was looking through some code today and came across something like this. if (checkSomeValueInTheDatabase() && someValue == someOtherValue) // Do something... Now this is a completely legitimate conditional statement. But it's not very performant. You should always use boolean short circuits to your advantage when writing conditional statements. Start with the conditions that are the easiest to evaluate then work your way down to the ones that use a lot of resources, like hitting the database. ......

Posted On Wednesday, July 20, 2011 12:40 PM

Copyright © PhubarBaz | Powered by: