[oclug] Programming wars -- great fun.
burkby at burkby.com
Sat Apr 7 08:38:52 EDT 2001
"Michael P. Soulier" wrote:
> I know Perl better, so my initial answer was Perl. :) Then I thought, "how
> would I do this in C?"
I found myself in a similar situation Mike. Did a quick Perl solution;
was just *way* too easy. I noticed you were already doing C, and Python
was also taken. Not hard to see what languages would win the tests for
size, speed and prettiness.
After a while I settled on C++; I assumed nobody (in their right mind)
would prefer it for this task. Probably a loser in all 3 categories, so
I thought it would be fun to try.
I figured I could at least compensate for losing Perl's flexibility by
using some of the STL container classes. This also helped prevent me
from "cheating" by writing basically C code with a .cc suffix. But,
based on limited experience with another implementation of STL, I
expected the thing to be really slow.
I was surprised. After minor tuning, the thing ran consistently 30-40%
faster than the regular `tree' program. Not really a fair comparison,
but an interesting indicator anyway. I ended up quite impressed with
g++; my preconceived notions were probably similar to some of the
irrational prejudice against Perl.
[Thanks and congratulations to Vic, for taking what started out as
another pointless language feud, and turning it into a very pleasant
More information about the OCLUG