Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
There are many programs that I have always been assigned when learning a new language that help you grasp the basics.
Odd that both examples you gave are usually the ones that programming books give to teach recursion. I wouldn't exactly call that a basic topic for most new-to-programming types. I always mention recursion and dance around it for a little while to expand a few brains in the audience. Then take those students who are prepared for it (aside) on an adventure through factorials, fibonacci, reversing strings/arrays (non-perl classes), and to cut the wheat from the chaff: Towers of Hanoi.

It's terribly useful when you need it, it's good that they're aware of it even to point out some uses (trees, etc...) but when they're busy grasping the concept of what a subroutine/function is, it can be a but much. Forget recursion for most, come back to it later when you can traverse directory structures or search b-trees or something.

PS: The other problem I've had with Fibonacci and factorials in particular is they're terribly easy to program, but they're not useful in everyday life. If I have to explain the math (which with those two to an average audience, I usually do) it's not worth the trip.


In reply to Re: Re: Can a non-programmer teach Perl? by clintp
in thread Can a non-programmer teach Perl? by Ovid

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 learning in the Monastery: (5)
As of 2024-04-18 11:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found