Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How did you learn Perl?

by cjf (Parson)
on Mar 27, 2002 at 19:25 UTC ( [id://154777]=note: print w/replies, xml ) Need Help??


in reply to How did you learn Perl?

If you're new to programming, I recommend you learn the basics of C first. It will help you understand Perl, and programming in general a lot better.

After you've got the basics of C down, a read through the Lama is a great way to get started with Perl. Don't worry if there are a couple parts you don't entirely understand, you can come back to them later. The most important thing is to actually write some code. Writing short examples to teach yourself what the various functions do and to get used to the syntax will help a lot.

After you've got an basic understanding of the syntax and a few of the core functions, start building fun stuff. Where the inspiration comes from ? has some great ideas for where to look for ideas. Check out CPAN as well for some very useful modules. Also make sure to read over the Essential CGI Security Practices thread if you're placing any of your scripts online. Best of luck to you :).

Replies are listed 'Best First'.
Re: Re: How did you learn Perl?
by snafu (Chaplain) on Mar 27, 2002 at 20:42 UTC
    It's interesting that you say this. Actually, learning Perl for me has helped me to understand C better. I started out with shell scripting...well, actually I started out with BASIC and Pascal first (as far as programming in an uninterpretted language) and when I got to Unix I was a heavy shell scripter. Eventually, I moved over to Perl but that transition was very slow because I was intimidated by Perl's flexibility. The fact that you could do the same thing 10 different ways syntactically correct and the functionality of your code would basicly do the same thing was just hard for me to adapt to idealogically. I just had to dive in. That was where the fun began. I have never turned back and now when I read my books on C I totally understand them now whereas before I just had a hard time understanding the wording.

    _ _ _ _ _ _ _ _ _ _
    - Jim
    Insert clever comment here...

      To tell you the truth, I'm always split on this issue. I feel that C is better for learning the basic programming concepts, and makes you appreciate Perl more once you get to it. The other side is that by learning Perl first, you get to build interesting things a lot faster and in doing so often keep the student more interested. So it does depend on the student somewhat, if they're really interested in programming in general I'd definately recommend learning C first. Otherwise it's a toss-up, and since I'm terribly biased towards Perl, I often recommend C just to maintain some shred of objectivity ;-).

      I definately agree with your point that learning Perl helps one understand C better, I know this was true for me. I also believe the reverse is true, C helps you understand Perl better (some experience in a *nix environment helps as well). Keep in mind, Whatever people think about C vs Perl as an introductory language, at least they're both not Java :)

        hehehehe...yes. I like your last statement. Although, I have never even attempted developing in Java, I have heard monster stories about it. No, not about the coding aspect but about how it runs. *shrug* I can only take what people tell me about it. I really know very little about Java.

        As for the Perl vs C first and vice versa, you're right. It's all subjective. Everybody learns differently. And thank goodness too! If we were all the same it would be a boring life, ya know?

        _ _ _ _ _ _ _ _ _ _
        - Jim
        Insert clever comment here...

        I came to Perl from a long C background, so most of the syntax wasn't the issue. It was the regular expressions that I had only touched on in UN*X that was my stumbling block (and many others' since they look foreboding and yet are a godsend). Now I love them, but it took me a lot of "tough loving" to beat them into my skull.

        Usually when people ask me how to get into programming, I tell them to use Python. It's a great prototyping language with similar syntax to several other common languages. It has the same logic structures and (this is the key) forces good formatting habits. It is also easy to convert Python to C code as long as you make sure that you use options that are native to both languages.

        We've all dealt with bad style, and I truly believe it comes from never being taught good readable style in the first place. By forcing them to tab their logic, it teaches them readability, which is extremely important as they move to other languages without strict rules of style.

        Once they have a sense of readability, they can adopt their style to the language as they read others code and find what feels natural. Then, perhaps, their code won't look obfuscated on accident.

        In reality, any language can be learned first, but I like to advocate Python because I feel that they will become better programmers in the long-run. Many languages give programmers the freedom to get set in their ways before they know what their ways are, and that is a problem.

Re: Re: How did you learn Perl?
by Silicon Cactus (Scribe) on Mar 28, 2002 at 01:13 UTC

    Like snafu, I have mixed feelings on this. My reasoning is a bit different, and I tend to agree with cjf. I realise C is sometimes a difficult language to get started with, syntactically, however it is also a very structured language.

    The flexibility of perl is nothing like I have seen before. Just the simple omission of rigid data-types makes it much easier to work with. (At least I think so)I also think that this same flexibility could become a problem if you START learning with perl.

    Plus, look how much more you appreciated that flexibility after working with such a rigid structure. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://154777]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-19 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found