On 8/14/06, Don <THX1138 at dakotacom.net> wrote:
I don't blame languages. I blame the folks who
either
don't fully understand the characteristics/consequences of
certain language features *or* the folks who don't
understand (nor appreciate) how to *test* things.
Agreed. I ran into a Perl debugging situation at one company where
the code to hit the database and aggregate thousands of e-mail
addresses was written by a web developer and then handed off to a
database developer when the first guy left. Essentially, the problem
was that on a particular day, the code, which had been working, got
swamped because it was (legitimately) being asked to handle 20 times
the normal amount of recipients. At the bottom of everything, there
was a loop with '$x .= $r[$n]' sort of a construct in it to build a
list of names, and there was so much string copying going on in the
loop that the Perl interpreter eventually barfed (after chewing on the
list for 8 hours). My solution was to replace the inner loop with a
'$x = $r[$a..$b]' construct - the modified program ran to completion
in 20 minutes.
The "real" problem was that the first guy didn't really understand the
impact of his original construction on the underlying system, and "it
worked" for a few thousand names. Didn't scale worth beans, though.
-ethan