in reply to bloated 'if' formatting
As far as aligning the conditions above, I'm not sure if you're asking about indenting with tabs, or aligning the conditions vertically (no matter how you indent). Aligning the conditions vertically really depends on the length and complexity of said conditions. For example:
# Short conditions, I wouldn't align vertically: if ($foo && $bar && $bat && $waffles) { statements(); } # Long or complex conditions, I would align vertically # (also personally prefer binary operators at the end # of the line rather than the beginning): if (some_long_conditions_go_here() && another_one_down_here($foo) && ($foo || $bar) && I_think_you_get_what_I_am_saying()) { statements(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: bloated 'if' formatting
by radiantmatrix (Parson) on Oct 06, 2005 at 18:20 UTC | |
by Nkuvu (Priest) on Oct 06, 2005 at 19:02 UTC | |
by Perl Mouse (Chaplain) on Oct 07, 2005 at 08:30 UTC | |
by BrowserUk (Patriarch) on Oct 07, 2005 at 10:52 UTC |