--- Agustin Rivera <[EMAIL PROTECTED]> wrote:
> Ok, the local Linux guru has proclaimed that C would be faster than Perl.  I
> know C is very effecient so I don't really doubt him, but my question is....
> would it make that much of a difference?  I certainly wouldn't mind learning
> C, the only question is would be worth the time to port our Perl scripts
> over to it?  Right now our setup is Apache w/modperl, and I'm getting quite
> good at taking advantage of modperl's benefits.
> 
> Hope everyone had a safe New Year,
> Agustin Rivera

Agustin,

For C to be "faster" than Perl, the question arises:  what is your Linux guru 
comparing?  Sure, in
a head-to-head comparison of raw computing power of a finished product, C will usually 
be faster
than Perl.  However, that's a naive comparison.  There are generally four variables in 
a project:

    1. Scope
    2. Cost
    3. Quality
    4. Development Speed

Now, obviously no one wants to sacrifice quality (though, in practice, due to poor 
planning,
that's one of the first things to get sacrificed), so let's mentally cross that off 
the list.  If
your clients are really picky, scope is also difficult to sacrifice.  So, the cost of 
the project
and the development speed (cheap and fast) are often what gets left over.  Cost is 
often affected
by things other than programmer hours (licenses, travel, hardware, etc), but it's 
closely tied to
it.  As a result, the faster the development speed, the lower the cost tends to be.  I 
guarantee
that for any given application, competant Perl programmers will kick the snuff out of 
compentant C
programmers in terms of development speed.

Note that nowhere in there did I say anything about "how fast the program runs".  If 
it runs fast
enough for your clients, it's fast enough.  Period.  If I tell a client, "oh, I can 
due this
project in half the cost in a third of the time, but your program will run a bit 
slower", many, if
not most clients will opt to save the money.

Of course, I wouldn't write device drivers in C and currently, I'm working with 
Inline::C to learn
how to optimize certain portions of my programs (Inline::C is embedding C in Perl), 
but dollar for
dollar, our clients *love* Perl and would rather fight than switch.

For more information, I recommend reading this comparison: 
http://www.perlmonks.org/index.pl?node_id=67047&lastnode_id=6364

Cheers,
Curtis "Ovid" Poe


=====
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to