in reply to perl's forte

I like to use perl for jobs that need to be solved quickly, sometimes it's easier to boot right into a shell prompt and write the script straigt into the interpreter for a quick result than it is to compile a job. Perl also seems to be, as brought to my attention by the Sams Learn Perl in 24 Hours, an excellent scripting language for prototyping a job that will eventally be compiled in something like C, especially with it's syntax being close to that of C's. And besides, it's another thing to put on a resume :).

Replies are listed 'Best First'.
Re: Re: perl's forte
by hardburn (Abbot) on Mar 19, 2004 at 21:04 UTC

    Perl also seems to be, as brought to my attention by the Sams Learn Perl in 24 Hours, an excellent scripting language for prototyping a job that will eventally be compiled in something like C, especially with it's syntax being close to that of C's.

    If you're truely "thinking" in Perl, you'll find that a lot of your code won't map easily into a C equivilent. And if you're not thinking in Perl, you're probably not taking full advantage of the language. There are those who write Perl, and those who write in interpreted C.

    Now, that's fine if you're fully intending to prototype in Perl and then move to C (you just avoid using Perl idioms), but if you're humming along in Perl and suddenly the boss comes in and wants it redone in C, you might have a problem.

    IMHO, you shouldn't make a C translation an option until you have proven that you need the speed benefit. If Perl isn't a good fit for your task, use another language, but don't automatically go into C.

    /me does his part to keep the world safe from buffer overflows

    ----
    : () { :|:& };:

    Note: All code is untested, unless otherwise stated

      I am all to familair with the sceanrio of "humming along in Perl" and suddenly it is required to be rewritten in another language :). I haven't done much converting from Perl to C simply because the fact that Perl is much quicker and easier for me to work with, it is practical, as the name implies :). I didn't want to lead someone wrong with a bunch of my personal opinions, and I had made the connection between the basics of Perl being similar to the basics of C, with the exception of having to declare variable types in C :).