MSSql MySql Python javascript PHP java DotNet Ruby Hackme Takeawy Code Twitter Facebook

The house of developers, A website to classify and rank developers

 
 
 
 
Country Rank: 1
World Rank: 48
Profile Viewed: 6352
Points: 10452
Although my examples are made using PHP, this tip may be applied to many scripting languages. I entitled it as "return as soon as possible"™ and became quite popular when I posted it on my blog. It may be summarized as transforming: if ($conditionToPerform) {     perform(); } else {     return false; } to: if (!$conditionToPerform) {     return false; } perform(); The benefit of writing code this way may not be obvious, but take a closer look at the next implementatio...