Re: [PEPr] Comment on RFC::Coding standard enhancements
| From: | Helgi Þormar Þorbjörnsson | Date: | Sat, 08 Mar 2008 13:50:58 +0000 |
| Subject: | Re: [PEPr] Comment on RFC::Coding standard enhancements | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-49333@lists.php.net to get a copy of this message | ||
On 7 Mar 2008 18:37:35 -0000, Matthew Weier O'Phinney <
mweierophinney@gmail.com> wrote:
>
> Matthew Weier O'Phinney (http://pear.php.net/user/weierophinney) has
> commented on the proposal for RFC::Coding standard enhancements.
>
> Comment:
>
> I agree with all, with the same exception as Philippe Jausions -- I'd
> prefer that the ending paren be on the same line as the
> condition/parameter, and the opening paren by itself on the following
> line.
> This makes it easier to visually see the start and end of a block as the
> braces align.
>
>
>
> So,
>
>
>
> if ($var
>
> && $foo
>
> || $bar)
>
> {
>
> }
>
The reason for not liking this approach is simple, imagine you are doing
some testing and want to comment out a param, say $bar then you have to move
) down a line anyway but wouldn't have if you used ) { already but well
that's just me since I like being able to comment out say long parts of if
sentence without having to alter it back and forth more than I need.
if (
($foo && $bar)
|| ($aha)
|| ($lele && $helgi > 300 && $ended)
) {
}
But then again I'm also throwing down the params from the if ( line, only on
those larger if, damn I'm so making up my own CS along side the PEAR one it
seems ;)
- Helgi
>
>
> and:
>
>
>
> public function callSomeRidiculouslyLongMethodName(
>
> $param1
>
> $param2)
>
> {
>
> }
>