SQL call formatting style

Gervase Markham gerv at mozilla.org
Wed Apr 9 08:25:43 UTC 2003


>>>And placeholders should be able to be aligned vertically (perhaps this 
>>>should be the default in fact):
>>>
>>>  $dbh->some_longwinded_methodname(q{SELECT some SQL variables
>>>                                     ON multiple lines
>>>                                     IF necessary
>>>                                     WITH placeholders ?, ?, ?},
>>>                                   undef,
>>>                                   $placeholder,
>>>                                   $variables,
>>>                                   $here);
>>
>>We have to balance the readability of the DB call with the readability 
>>of the code in general, which isn't helped if each DB call takes up a 
>>third of a page. IMO, the vertical alignment of placeholders doesn't 
>>help enough for it to be worth it for all the lines it takes up.
> 
> I think you both meant s/placeholders/keywords/.

No, I meant placeholders - the thing Myk labels as $placeholder 
$variables $here.

I'm all for lining up the keywords in SQL queries.

>>>And this should be a recommendation, not a rule.
>>
>>Well, inasmuch as any Bugzilla coding standards are recommendations 
>>rather than rules; but I believe consistent coding standards are really 
>>important to keep our code understandable.
> 
> Whilst true, I think that we have a sufficent lack of resources that
> spending two weeks arguing about^W^Wdiscussing brace style was a waste
> of time :)

I have done other things in between. :-)

Gerv




More information about the developers mailing list