On Sat, Jul 29, 2006 at 11:08:51AM -0400, Edward Z. Yang wrote:
Tim Starling wrote:
The main reason I'm doing this is because I
think $foo.' '.$bar looks
ugly compared to "$foo $bar", and it also takes up more screen space. I
doubt the performance gain would be significant either way,
concatenation takes only 19us. I just don't like seeing the MediaWiki
codebase uglied up for specious reasons.
While I agree that if interpolation looks nicer then concatenation, you
should definitely use it, I don't think the test results mean very much.
String interpolation used to be quite slow, but the PHP team managed to
speed it up quite a bit from 4.2 to 4.3 to 5 (Schlossnagle 2004).
"If a programmer can simulate a construct more efficiently than the
compiler can implement it, then the compiler writer has blown it
*badly*". --Guy L Steele, in Harbisone & Steele.
"Premature optimization is the root of all evil." --Hoare, via Knuth
Cheers,
-- jra
--
Jay R. Ashworth jra(a)baylink.com
Designer Baylink RFC 2100
Ashworth & Associates The Things I Think '87 e24
St Petersburg FL USA
http://baylink.pitas.com +1 727 647 1274
Fanfic: read enough, and you'll loose your mind. --me