Note that all of the arguments can be applied to perl itself as well.
- LEARNING: Have you learned how to write hash functions, deal with signals, IO, and how to create a regexp engine? If not, it's better to use C and learn all those things than to use Perl.
- PERFECTION: Perl is slow. A perfectionist would write their stuff in C and have most of its stuff working orders of a magnitude faster.
- PURPOSE: many of the constructs Perl offers me don't exactly do what you need -- you'd be better of writing C primitives.
- APPEARANCE: Ever tried installing Perl and the myriad of modules and files that come with it? Just the endless list of questions being asked at Configure time alone. No, in other to not lose your precious access, it's much better to install a compiled C program (one file!) instead of the dozens and dozens of Mb of a Perl install.
- PORTABILITY: Perl won't run on boxes that you cannot compile on or cross-compile to. But there'll be some platforms your C program can be compiled on (or cross-compiled to) where Perl doesn't. So, for portability reasons, C program are superiour to Perl programs.
- CPAN ACCESS: You don't need any for a C program. Not even to install Perl from.
- COMPILING: Well, you got me here. If you don't have a C compiler, you cannot compile a C program. But wait, you cannot compile perl then either! So, this one will be a tie.
- COMPLEXITY: It doesn't make sense to install Perl for a one-off script, and then to remember to use /home/me/bin/perl each time you run it.
- SIZE: Buhahhaha. Perl is a memory hog, and that's before it's doing anything. People have written entire OSses with a full POSIX tool chain in less memory than Perl even needs to run perl -e "1".
- LICENSING: Perl gives you the option to either use the GPL, or the lawyers-field-day Artistic License. Legal may prefer you sticking to your C compiler.
- JOB: You're paid to write code, not to download perl. That would be cheating. Better build your own table and chair, given an acorn to start with. Anything else would be cheating.
I think C beats Perl 10.5 - 0.5 using your "reasons".
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.