I’m a fanatic about using tabs properly in code. It can make the difference between easily-readable code and a nightmare.

Of the two code segments below, which would you rather work with?

$out .= selectList(array('name'=>'type',
'id'=>'typeSelection',
'elements'=>array('Unspecified'=>'- please select -',
'questions'=>'General Questions',
'quote'=>'Request Info/Demo/Quote',
'order'=>'Place Order',
'comment'=>'Feedback/Comment'),
));
$out .= selectList(
			array(
				'name'=>'type',
				'id'=>'typeSelection',
				'elements'=>array(
							'Unspecified'	=> '- please select -',
							'questions'		=> 'General Questions',
							'quote'			=> 'Request Info/Demo/Quote',
							'order'			=> 'Place Order',
							'comment'		=> 'Feedback/Comment'),
				));

August 7th, 2013

Posted In: Syntax

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: