View Single Post
Old 07-01-2009, 05:25 PM   #20 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,324
Thanks: 5
Salathe is on a distinguished road
Default

Better indenting would have made this problem clear in an instant (there or there abouts)! Rather than having most things all mushed together along one vertical axis, follow a strict indenting system to make your code blocks much clearer.

Compare:
PHP Code:
function moo($lady FALSE) {
// This function moos!
if ($lady) {
steal_some_milk();
return 
ladylike_moo();
}
return 
big_manly_moo();

To:
PHP Code:
function moo($lady FALSE) {
    
// This function moos!
    
if ($lady) {
        
steal_some_milk();
        return 
ladylike_moo();
    }
    
    return 
big_manly_moo();

Multiply that by 10 or 100 for a file full of code (wow, lots of moos!).
Salathe is offline  
Reply With Quote