Re: using ($test)?$true:$false in a string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Heyes wrote:
Robert Cummings wrote:

On Mon, 2005-11-21 at 10:02, Richard Heyes wrote:

Readability is in the eye of the beholder.



But efficiency isn't ;)

yes it is actually - everything is in the eye of the beholder.
it just so happens that we often have consensus ;-)

with regard to the bulldozer metaphor - true that using sprintf() is
such a simple case may be excessive BUT I was merely introducing the OP to
something new (possibly) - anyone asking such 'simple' questions is
not at a stage that this kind of efficiency is an issue (i.e. give
them 'whats possible' before telling them 'whats best')

the sprintf() example leaves lots of room for creativity and
code reuse (even by relative newcomers) or aleast the possiblity of
writing more managable code.... Chris Boget liked it anyway :-)


PS - Robert Cummings, I totally agree with your general comments on
internals@ regarding migration/irritation/etc btw. and if I didn't
spend so much time on 'fixing' my working code I might have had time
to take a proper look at your InterJinn project - more's the pity
that I haven't been able to so far :-/



Try measuring the difference between the various methods over a realistic number of iterations, eg. 100. There's little point in going through ones code trying to "optimise" these things. Sure you might gain a millisecond here or there, but so what? You'd have to have a *seriously* busy site for that to make a difference.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux