Bug 471260 - RFE: Split long lines preference: operators at end or beginning of line
Summary: RFE: Split long lines preference: operators at end or beginning of line
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-29 02:07 EDT by KB Benton CLA
Modified: 2020-05-14 10:16 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description KB Benton CLA 2015-06-29 02:07:34 EDT
I developed a good habit where string delimiters are put at the beginning of a line rather than after.

$sql = "SELECT column1, column2, column3"
     . " FROM tablename"
     . " WHERE id = ?"
     ;

The reason I like having delimiters on the beginning of the line is it makes it very clear that the "next" line is there as a continuation of the previous line. It also makes adding a new line or taking an existing line away very simple.

The same would potentially apply with comma delimiters:

$columns = array( "column1"
                , "column2"
                , "column3"
                ) ;

The same can be true with math operations, logic operations, and others like it:

$total = $baseRate
       - $discount
       + $localTaxes
       + $countyTaxes
       + $stateTaxes
       + $shippingCharge
       + $handlingCharge
       ;
Comment 1 KB Benton CLA 2015-06-29 02:25:29 EDT
Bug 452255 is similar to this bug but not as generic.