Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: C or Perl

  1. #1
    Junior Member
    Join Date
    Dec 2004
    Posts
    12

    Question C or Perl

    I just want to step into system programming and i want to know whether i should use C or some scripting language like Perl.
    By the way,i have a good knowledge of C and i am new to Perl.
    So can some one tell me which language is better and which one should i use?

  2. #2
    T3h Ch3F
    Join Date
    Sep 2001
    Posts
    718

    Re: C or Perl

    Originally posted here by Neil Mcnzee
    I just want to step into system programming and i want to know whether i should use C or some scripting language like Perl.
    By the way,i have a good knowledge of C and i am new to Perl.
    So can some one tell me which language is better and which one should i use?

    No.

    heheh.
    Get some good religion from Bad Religion.

  3. #3
    Depends on what you are intending to do, if you are goin to go cross platform... Many many many different things.

    First what are you goin to do with the language? Are you just going to be writing programs for your comp to bs with?


    Are you intendin to get a job with the language that you learn?

    Also where do you intend on learnin from, do you intend on asking a lot of questions?

    Honestly, know both languages the question depends on multiple things.... Answer a couple of those questions and I will be able to help you out.

    Oh and if you intend on asking a lot of questions, just go for perl... The perl community is a lot more acceptive of new people, than the C community... Plus there are several perl sites to help you out.


    www.perlmonks.org is probably the best.

  4. #4
    Jaded Network Admin nebulus200's Avatar
    Join Date
    Jun 2002
    Posts
    1,356
    Think this is the key phrase:
    just want to step into system programming a
    System programming usually involves more scripting than anything, and perl is one of the better ones. But if you are going to be doing that kind of stuff, you need to be able to script in more than one 'language', at a minimum you should also know how to do it in 'sh' but other things like python would be good to know as well.

    If on the other hand, you really meant things like writing device drivers, etc, you would be better off learning C, which is a more low-level programming language.

    And still yet if you were interested in doing GUIs, probably wouldn't hurt to know Java, since it is one of the few cross-platform languages...

    Getting the idea yet? You can't pick just one
    There is only one constant, one universal, it is the only real truth: causality. Action. Reaction. Cause and effect...There is no escape from it, we are forever slaves to it. Our only hope, our only peace is to understand it, to understand the 'why'. 'Why' is what separates us from them, you from me. 'Why' is the only real social power, without it you are powerless.

    (Merovingian - Matrix Reloaded)

  5. #5
    Leftie Linux Lover the_JinX's Avatar
    Join Date
    Nov 2001
    Location
    Beverwijk Netherlands
    Posts
    2,534
    since we've had the C and Perl discussed..
    And since I agree with nebulus200 that there should be some shell script skills..
    Most runlevel stuff on most linux distro's and also a lot of other 'glue' is written in bash.
    read this: http://www.tldp.org/LDP/abs/html/
    ASCII stupid question, get a stupid ANSI.
    When in Russia, pet a PETSCII.

    Get your ass over to SLAYRadio the best station for C64 Remixes !

  6. #6
    Banned
    Join Date
    Jul 2005
    Posts
    511
    Keyword here is "system programming"... That would require C++... Scripting is more often used for management tasks, calling specific applications in specific order.

    About what's the best language? Well, there isn't any. They're all just good for their own specific purposes.

    Btw, C++ is a language that is pretty platform-independant. Only when you compile it and link it with certain libraries it's fixed for a certain platform. But a simple "Hello, World." application would compile on any platform with a C++ compiler for that specific platform.

    But I hope you realise that C++ and Perl aren't the only languages. My advise? Just try to read about all languages that are available and then pick the one you like most.

  7. #7
    Leftie Linux Lover the_JinX's Avatar
    Join Date
    Nov 2001
    Location
    Beverwijk Netherlands
    Posts
    2,534
    System programming in C++ ??

    I thought that stuff was always done in C (kernel etc) !!
    ASCII stupid question, get a stupid ANSI.
    When in Russia, pet a PETSCII.

    Get your ass over to SLAYRadio the best station for C64 Remixes !

  8. #8
    Senior Member DakX's Avatar
    Join Date
    Jul 2005
    Posts
    128
    Originally posted here by the_JinX
    System programming in C++ ??

    I thought that stuff was always done in C (kernel etc) !!
    For as far as i know (please correct me if i am wrong) It can be done in both. I found a paper that has the difference between c and c++ explained. I haven't read it myself but you can alway's try it.>click<.

    I just want to step into system programming
    Then you should chose C. But if you want to specifie it I would suggest looking for the best language for that job because C isn't good at. everything.
    Hope you find this usefull.
    [T]he future is now.

  9. #9
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    Originally posted here by DakX
    For as far as i know (please correct me if i am wrong) It can be done in both. I found a paper that has the difference between c and c++ explained.
    C is procedural and C++ is object oriented.. That's the simplest explanation of the differences.
    Perl can be used OO but also as a procedural language..

    If you don't have any programming experience I would recommend Perl. It's really easy to learn, no need to declare variables, memory management etc... Syntax is very forgiving.. You can use a C style syntax but also a more "basic" style... You can even combine different styles (not recommended though, makes the source rather hard to read). And it's mostly platform independant (if you don't use platform dependant modules that is)....

    C on the other hand gives you a lot of power at the cost of having to do everything yourself; declare variables, get/free memory etc.. C will give you enough rope to hang yourself..

    As for system programming (meaning OS, drivers etc) both C and C++ are used.. The Unix (and alike) systems are traditionally written in C.. Heck, They've invented C to write UNIX.. IIRC Windows is mostly written in C++.. C++ tends to produce a more "bloated" code IMO..

    I can do all, but I use Perl the most.. I use it for nearly everything, as a quick development for a tool I need, as web-CGI, log analysis, network/server management... Perl is usually called the swiss army chainsaw.. Because you can use it for everything and it's really powerful.


    Oliver's Law:
    Experience is something you don't get until just after you need it.

  10. #10
    Banned
    Join Date
    Jul 2005
    Posts
    511
    Actually, because Perl doesn't need to declare variables or manage the memory and simply because it's syntax is so forgiving, I would actually advise AGAINST using Perl to learn programming. Sure, it will be easier to learn to program by using Perl, but you will also learn some sloppy programming techniques that will start to haunt you once you're trying to develop in some other language.
    Personally, I think it would be better to learn some language that has a very strict syntax first, so you'll learn the most important things about programming, which is programming decent code. Pascal is very strict, C/C++ is slightly less strict but still unforgiving in many cases.

    Besides, like Perl, C code is platform-independant. The thing that does lock up C code to a certain platform are only the additional libraries that you might need to do some more advanced stuff.

    There are many people though who chose for scripting languages like Perl, PHP and whatever more because these are just simpler to use and have a less strict syntax. While scripting can be very powerful, I personally feel it's more for lazy programmers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •