Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Perl or C?

CheemasterCheemaster Posts: 3Member
I was just wondering if I should learn Perl or C first? I have a tiny bit of previous Programming experience(HTML,XHTML,CSS, QBasic, and a tiny bit of Realbasic) and would like to expand on it. I have well suggested books on both that my mom got me as a gift.
Any help is appreciated and thanks in advance.

Comments

  • JonathanJonathan Posts: 2,914Member
    : I was just wondering if I should learn Perl or C first? I have a
    : tiny bit of previous Programming experience(HTML,XHTML,CSS, QBasic,
    : and a tiny bit of Realbasic) and would like to expand on it. I have
    : well suggested books on both that my mom got me as a gift.
    : Any help is appreciated and thanks in advance.
    :
    I learnt Perl first, and like you came from a Basic background (QBasic, then Visual Basic). I later learnt C. As for which is a preferable order to do them in, well...it's hard to say.

    If you do C first it will get you fairly well disciplined with stuff like declaring variables etc. Perl cuts you a *LOT* more slack than C. On the other hand, that could be a reason to learn Perl first - it's more forgiving and you can write programs in it more quickly.

    In C, the big thing you have to do that Perl does for you is memory management. You probably won't have run into having to do your own memory management before. It's not a really big deal, you just have to be careful (my lack of care once led to a 10MB / minute memory leak!). That won't happen in Perl. There is also a lot more potential to write "dangerous" code in C.

    You may already know that Perl (the program) itself is written in C. If not, you do now.

    Perl and C are good for different things, though by the sounds of it your intention is to learn both, which I'd strongly advise. They are the two languages I work in to do most of my real programming these days, and I've grown to greatly love both of them. Though my sweetest spot, will always be for Perl. ;-)

    Hope this helps - I don't want to tell you one way or the other, but hopefully it gives you some reasons for choosing either way that you can weigh up.

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • WeirdofreakWeirdofreak Posts: 439Member
    Perl was the first 'real' programming language I learned (I knew a bit of BASIC, but nothing at all useful - I didn't even know it was possible to declare variables as anything other than user input - and plenty of Javascript, but that's only useful for flashiness, really), and it's the only one I can do much in. I started learning C++, but got sidetracked and never started again. Perl is by far the easier to read, by common consent, which makes it easier to learn from others' code, and not having a limit on string size, while probably not as helpful as it seems, is comforting. You also don't need specific functions to work with strings, whereas in C++ if you don't import the right file and use the right functions, you end up having to change each character separately. Not fun.
Sign In or Register to comment.