Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chaoticset (2105)

  (email not shown publicly)
AOL IM: chaoticset23 (Add Buddy, Send Message)
Yahoo! ID: illuminatus_foil (Add User, Send Message)

JAPH. (That's right -- I'm not Really Inexperienced any more.)

I'm not just here, I'm here [], and here [] too, I ramble randomly in my philosophical blog [] and my other blog []. Soon I'll come in a convenient six-pack.

Journal of chaoticset (2105)

Sunday March 10, 2002
08:31 AM

Mongolian Death Flu

[ #3408 ]
That's what Dave Barry calls the flu-ness where your whole body hurts, and your eyes feel like they've been lit on fire, and half your sinus cavity dries out and is irritated, and the other half is so full you can't breathe through it...

I'll stop now. You probably know what I'm talking about.

I didn't come here to write about that -- I came here to discuss a fairly interesting little experience I had recently.

Looking through The Practice Of Programming while looking to purchase some books on the topic, I came across the most interesting thing; a program done in C, C++, Java, Awk, and Perl, and a table showing how many lines it took and how much time on a P2 233 and a P3 450. I turned it around to show Laura.

The C version took 3 seconds. Java took 4 something, and something was seriously wrong with the C++ version, which took some 11 seconds or so. What surprised her was when I showed her that the Perl one took three times as long as the C one.

"But what's the advantage of Perl over C, then?"

I pointed to the number of lines of C: 150. Then I pointed to the number of lines of Perl: 18.

She cocked her head. I went on to explain about less code = less typos, faster debug time, etc.

I consider it a lesson to me that I both need to learn C (in order to be able to create time-sensitive things) and learn more Perl (in order to work quickly).

I also, unfortunately, am probably going to end up taking a Java class whether I like it or not. Not many language courses are given where I'm going to school.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • As I recall, the perl version in that book had a fair bit of room fo improvement. It was missing a number of idiomatic perl usages; ones that were used in the awk version of the same program and mesntioned as deficiencies in perl.
    • I didn't actually scan the code itself; for some reason, when I go to bookstores to relax I find myself trying to read as quickly as possible. :\

      Maybe, now that I've purchased it, I'll see if I can improve the code significantly.


      You are what you think.