I disagree. The Inline Method may be less compact than the Traditional Method but it is much easier to read. The following are two identical code sniplets. One is formated with the Traditional Method and the other with the Inline Method. You make the decision which one you want to use.
In my opinion the Traditional Method is a mess.. You can't tell where each block ends without thuroughly studying the code. But it is compact. I can see why this method would have been adopted by early programmers with large text on small screens. Question is would you need to be compact these days when you have 10 point type on a 1280x1024 (or larger) screen? /** TRADITIONAL METHOD **/ foreach ($mylist as $key => $val){ if ($key == $list_num){ for ($i=0; $i<count($key); $i++) { record_list($key[$i]); } }elseif ($key == $skip_val){ continue; }else{ echo "INVALID ENTRY: "$key ." at ". $val . "\n"; } } /************************/ On the other hand the Inline Method is clean. You can see at a glance where each block begins ends. But it is not compact. It spreads the code out over many lines. I recommend this method for modern programmers coding on large screens. Besides that I think it's just a better way to code. More whitespace = less confusion = faster debugs. /**** INLINE METHOD *****/ foreach ($mylist as $key => $val) { if ($key == $list_num) { for ($i=0; $i<count($key); $i++) { record_list($key[$i]); } } elseif ($key == $skip_val) { continue; } else { echo "INVALID ENTRY: "$key ." at ". $val . "\n"; } } /************************/ ----- Original Message ----- From: "Analysis & Solutions" <[EMAIL PROTECTED]> To: "PHP List" <[EMAIL PROTECTED]> Sent: Thursday, April 11, 2002 12:13 PM Subject: Re: [PHP] Tutorial on proper code formating > On Thu, Apr 11, 2002 at 01:33:40PM -0400, Erik Price wrote: > > > > http://utvikler.start.no/code/php_coding_standard.html > > Uch! Uch! Uch! I don't like their nesting ideas: > if (condition) // Comment > { > } > else // Comment > { > } > > This is the standard I learned and find easier to read: > if (condition) { > # Comment > } else { > # Comment > } > > http://www.perldoc.com/perl5.6/pod/perlstyle.html has some ideas too. > But it also calls for "uncuddled elses." > > Here's a link to another style guide > http://slashcode.com/docs/slashstyle. > > In essence, you'll find that tastes vary. > > --Dan > > -- > PHP classes that make web design easier > SQL Solution | Layout Solution | Form Solution > sqlsolution.info | layoutsolution.info | formsolution.info > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php