[dev] reference assignments

Chuck Hagenbuch chuck at horde.org
Thu Feb 23 17:38:47 PST 2006


Quoting Michael M Slusarz <slusarz at mail.curecanti.org>:

> Noticed on some of the commits that you have flip-flopped on the
> reference assignment syntax.  According to docs/CODING_STANDARDS:
>
> If assigning a reference to a variable, place the ampersand next to the
> referenced object, not the equal sign::
>
>    $reference = &$foo;
>    $reference = &foo();
>
> Have we changed that now?

Well, I've changed my thinking on it. I had forgotten that was  
explicitly mentioned in the coding standards; I've just taken it out  
since it's not something I think is "wrong" either way. I used to feel  
like the & was modifying the variable or function, not the assignment;  
now I feel like it's a bit clearer to read it as having the & modify  
the assignment, not the variable or function. If that makes sense.

-chuck

-- 
"we are plastered to the windshield of the bus that is time." - Chris


More information about the dev mailing list