Re: [PEPr] +1 for Math::Math_Fraction

From: Date: Thu, 09 Dec 2004 19:02:44 +0000
Subject: Re: [PEPr] +1 for Math::Math_Fraction
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-34972@lists.php.net to get a copy of this message
> All operators should have spaces around them ($den=null and $n/$d). As the goal of the spaces is to improve the readibility, in some cases they could be harmful. For example IMHO: Math_Fraction($num/$gcd, $den/$gcd) looks better than Math_Fraction($num / $gcd, $den / $gcd), because you could immediately see what the arguments are. However, for most of the cases you're right. Actually I haven't found anything on that topic in the Coding Standards, I mean to put spaces around *all* operators. > Return and pass-by-ref should be removed unless you provide a compelling reason for keeping it in. If for no other functions, for reduce and simplify this should be done as it may return the passed in object *or* a new one. This could quite easily cause confusion. Is the "memory gain" factor strong enough or I really have to use references when the logic requires it - as in the "reduce" example? Kouber

« previous php.pear.dev (#34972) next »