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

Perl as an intro to programming

by jrsimmon (Hermit)
on Feb 27, 2009 at 12:50 UTC ( #746862=perlquestion: print w/replies, xml ) Need Help??
jrsimmon has asked for the wisdom of the Perl Monks concerning the following question:

A coworker approached me about his son's interest in programming. I gave him basic directions to get perl installed (nevermind why I chose perl--it's what suited the situation best in my opinion and not really what I'm asking about).

That said, what are good activities for someone (young, age 14 or so) who is being introduced to the world of programming via perl? Does anyone have experience with this? Suggestions for things that will be fun, in order to keep the kid's interest, yet still worthwhile?

Update:
Keep in mind that this is truly intro-level. Ie, "what's a for loop?".

Replies are listed 'Best First'.
Re: Perl as an intro to programming
by eyepopslikeamosquito (Chancellor) on Feb 27, 2009 at 19:50 UTC
Re: Perl as an intro to programming
by ELISHEVA (Prior) on Feb 27, 2009 at 13:47 UTC
    Writing simple games, for example, hang man, tic-tack-toe, or the card games war or blackjack can be a fun way to learn about graphics, html generation, and data structures. The basic algorithms are simple, but there is a lot of opportunity to "pretty things up" and integrate both sound and graphics (or even the web) to make the game "cooler".

    But like buying gifts for kids, a lot depends on the kid and what gets him or her excited. I would suggest first asking him or her what sort of things he or she would like to do with software. Use your own experience to assess the skill set needed and then work with them to scale the project down to something do-able but still "cool". Alternatively, work on the project together, with you carving out pieces that require a set of simple skills. Then as the teen gets more comfortable you could carve out large or more complex chunks. If you worked on it together it could turn into the electronic version of parent-child cooking or wood-working.

    Best, beth

Re: Perl as an intro to programming
by moritz (Cardinal) on Feb 27, 2009 at 13:01 UTC
    I don't know if that's much fun, but you could tell him about rename (or sometimes called prename) which takes a perl expression to rename files. I've used that extensively to clean up the file names of my various music files.

    I could imagine that this something that's useful for him.

    (and tell him about that -n option ;-)

Re: Perl as an intro to programming
by zentara (Archbishop) on Feb 27, 2009 at 13:42 UTC
    Eventually he will get bored with commandline stuff.....show him some Tk and Gtk2 GUI apps...that will stimulate his imagination. There is nothing like popping a toplevel window open, to impress your friends. :-)

    I'm not really a human, but I play one on earth My Petition to the Great Cosmic Conciousness
Re: Perl as an intro to programming
by Zen (Deacon) on Feb 27, 2009 at 15:23 UTC
    What I enjoyed as a kid:

    Writing games. Card games, adventure games, etc.
    Mathematically correct battle simulations of my favorite games


    Other ideas include sports analysis, text editors, simple gui games, and breaking into the family router. :-D
Re: Perl as an intro to programming
by Wiggins (Hermit) on Feb 27, 2009 at 14:04 UTC
    I am going to skip the "Suggestions for things that will be fun" and go out on a limb, possibly by myself.

    Perl is a great language to stimulate a "problem solving" mentality. What tool (command) is best to get this part of the job done? And problem decomposition recognition, break big tasks into smaller ones. Or finding ways to generalize a solution to be useful to a class of problems.

    But all of these are more in the realm of "System Engineering" as opposed to "Software engineering". I am not saying that most people in this field don't wear both hats in differing proportions most of the time.

    At 14, Perl is fine to see if it stimulates the needed personality traits of the latent programmer. But down the road there are a lot of fundamental concepts that need to be understood in a more rigorous fashion, such as parameter passing methodologies, memory management (allocation, freeing, and reference counting), and other low level foundational concepts.

    My progression was FORTRAN(no number), ALGOL, SNOBOL, early PASCAL,CDC Asssembler, COBOL, PL/1, REXX, 6502 & 68010 assembler, C, C++, (dropped JAVA), and now PERL

    It is always better to have seen your target for yourself, rather than depend upon someone else's description.
Re: Perl as an intro to programming
by targetsmart (Curate) on Feb 27, 2009 at 16:07 UTC
    From your post it seems that he has interest/enthusiasm, that is the basic ingredient, then introduce perlmonks.org to him. Because when I entered perlmonks(got here via google) I had only very little programming experience and a little english, I was comfortable looking at Q&A, tutorials, SOPW ... Now I feel that I have progressed.(but still a long way to go).
    perlmonks and the community is really great...

    Vivek
    -- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.
Re: Perl as an intro to programming
by apl (Monsignor) on Feb 27, 2009 at 15:57 UTC
    Have the teen write a Guessing Game program, one that asks questions and tells you whether your answer is correct or not. He'd need to read a list of questions (with one word answers) from a file, store them in a structure, prompt the user with a random question, read the answer, check for correctness, etc.

    It's non-trivial, teaches a lot of the basics of Perl (or any other language) and is something he can beta test on his friends.

Re: Perl as an intro to programming
by realn0whereman (Novice) on Feb 27, 2009 at 13:04 UTC
    check out javabat.com for ideas. when i was first introduced to perl my "mentor" gave me simple assignments such as "given any word as input, output the reverse of the word" and "in oneline of code print all the numbers from one to 100"
Re: Perl as an intro to programming
by whakka (Hermit) on Feb 27, 2009 at 23:41 UTC
    Does the young person...
    • Like games? Card games are very fun and simple to implement, or simple text games like Russian Roulette, one of my faves. (Update: pay no attention to that sadist below!)
    • Like sports? Learn how to automate getting articles/stats/feeds off the web on a favorite team/player.
    • Like technology? Learn about networking, sockets, cool SMS/email tricks.
    • Like music? Learn how to organize mp3s by their tags, make apps that make customizable playlists or stream music over a network connection.
    • Like the web? Learn how to make a basic home page with dynamic content, using CGI and the like. Make a "super" Facebook page.

      "simple text games like Russian Roulette"

      rm -rf / if you lose. Or, if you do not want to gamble too much, shutdown -r now :)

      And, to make it even more fun, make it a networked, multiplayer, game. :P

      And you didn't even know bears could type.

Re: Perl as an intro to programming
by Anonymous Monk on Feb 27, 2009 at 12:57 UTC
    have him download this years sports illustrated swimsuit issue, but don't let him cheat of merlyn
Re: Perl as an intro to programming
by Anonymous Monk on Feb 27, 2009 at 21:57 UTC

    Tell him right away that if he wants to get laid sooner than when he gets about thirty, has a well paying job and the females in his age group start to build the nests and look for someone who can provide money for the kids rather than fun for the chick, he'd better forget programming and do something that girls understand and appreciate. Whether it is the game of the oversized dumb (american football), the game of the overgrown (basketball) or some other sport popular in whereever he lives. If he's not tall or dumb enough he can try ballroom dancing. He'll be made fun of by the guys, but there tends to be enough good looking girls in the area.

      How cliché~

      And you didn't even know bears could type.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://746862]
Approved by jdporter
help
Chatterbox?
[Corion]: Hurr - as I'm running some not-so-static websites nowadays, maybe I really should implement a link checker that crawls these sites and checks that all internal links work ...
[Corion]: (in the sense of not returning 404 errors)
[1nickt]: Corion Surely you have one or more lying around?

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2017-10-18 11:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (244 votes). Check out past polls.

    Notices?