On Mon, Mar 07, 2005 at 11:23:22AM -0500, Aaron Sherman wrote:
> On Mon, 2005-03-07 at 10:57, David wrote:
> 
> > I'd posit that the correct answer is: "rewrite it."
> > 
> > And adding a space between $x++ and +1 is nowhere near enough.
> 
> Why not?
> 
>       $y = $x++ + 1;
> 
> is quite readable, and very clear in its intent if you know know what
> "postfix:++" and "infix:+" do (and you'd better). You don't even have to
> know precedence, as it is implied by the (now correct) use of
> whitespace.

It's fairly readable (which is subjective anyway), but I don't think it is
clear in its intent.  Since it is equivalent to C<< $y = ++$x >> when $x is
a number, I would be unsure why the programmer wrote it in the more
complicated way.  Did they really mean to do that, or were they trying to
do something different and erred?

Ronald
 
_______________________________________________
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to