[Tutor] concat vs join - followup

Alan Gauld alan.gauld at blueyonder.co.uk
Sat Aug 28 08:53:43 CEST 2004


Hi Kent,

> I started this experiment because I have been telling people on the
Tutor
> mailing list to use join, and I wondered how much it really
mattered. Does
> it make enough of a difference to bring it up to beginners? I'm not
sure.

Its easy to get carried away with premature optimisation.
I did the same in my tutor by mentioning that a deferred import
is slightly faster, now I see lots of folks deferring imports in
inappropriate cases and wish I'd kept my advise to myself because
the performamce win is tiny and the readability loss significant!

> It's good to teach best practices, but maybe it's a poor use of time
to
> teach this to beginners. I won't be so quick to bring it up next
time.

Yes, when someone has a performamce problem, that's probably the
best time to introduce tuning tricks. Until then, if its "fast enough"
why bother?

But OTOH the research to find out is interesting.
As a matter of interest I usually use string fomatting
to build long strings rather than join or concatenation.
How does that compare for performance? :-)

Alan G.



More information about the Tutor mailing list