Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Start by learning to read code.

One of my cynical canned rants deals with the idea that programmers are people who know how to write, but don't know how to read. When I'm especially grumpy, I say that most programmers don't even know how to write code.. they just engage in partially-directed genetic algorithm development, with the compiler and test code telling them whether the latest random twiddle will work.

You can actually get a lot of value out of retyping a program that somebody else wrote. Just the act of pounding those statements into the keyboard in the correct order gives you space to think about what's going on, and what the original programmer was thinking.

If you keep at it, you'll learn to recognize various concepts, which will give you the basis you need to discover even more. Eventually, you start to recognize personality traits of the programmer who wrote the code.. this one's an optimist, that one's a pessimist, this one builds structure by the numbers, that one lets it evolve like jazz. And as you expose yourself to acres of code written by people who've already developed a style, your own will evolve, almost by osmosis.

Existing code also gives you a starting point where everything works. There are few things more frustrating than slogging through umpty-seven permutations of code because the documentation was written for somebody who already knows how to make everything work. Start with what works, so you can go back and get that little fix of success when you need it. Swear to God, when I'm deep in the guts of some problem that isn't ready to get up and limp yet, I'll write "hello, world." programs to keep myself from going nuts.

And as it happens, Perl comes with a whole library of code that you can read, copy, and play with. Want to understand namespaces? Read Exporter.pm. Want to understand data structures? Read Symbol.pm. Want to test the limits of your sanity? Read CGI.pm. ;-)

Seriously, read the libaries. I try to go through the whole batch at least once every year. And I learn something new every time.

mike
.


In reply to Re: what is the best way to learn to program? by mstone
in thread what is the best way to learn to program? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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> <u> <ul>
  • 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 intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found