Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

[ Create a new account ]

How To Encourage a Young Teen To Learn Programming?

Posted by Soulskill on Tuesday July 22, @05:11AM
from the electroshock dept.
Anonymous Hacker writes "I'm in a bit of a bind. My young teenage son is starting to get curious about computers, and in particular, programming. Now, I'm a long time kernel hacker (Linux, BSD and UNIX). I have no trouble handling some of the more obscure things in the kernel. But teaching is not something that I'm good at, by any means. Heck, I can't even write useful documentation for non-techies. So my question is: what's the best way to encourage his curiosity and enable him to learn? Now, I know there are folks out there with far better experience in this area than myself. I'd really appreciate any wisdom you can offer. I'd also be especially interested in what younger people think, in particular those who are currently in college or high school. I've shown my son some of the basics of the shell, the filesystem, and even how to do a 'Hello World' program in C. Yet, I have to wonder if this is the really the right approach. This was great when I was first learning things. And it still is for kernel hacking, and other things. But I'm concerned whether this will bore him, now that there's so much more available and much of this world is oriented towards point-n-click. What's the best way to for a young teen to get started in exploring this wonderful world of computers and learning how to program? In a *NIX environment, preferably." Whether or not you have suggestions for generating interest or teaching methods, there was probably something that first piqued your curiosity. It seems like a lot of people get into programming by just wondering how something works or what they can make it do. So, what caught your eye?

Related Stories

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • python (Score:5, Interesting)

    by utnapistim (931738) <dan,barbus&gmail,com> on Tuesday July 22, @05:15AM (#24286157) Homepage

    Teach him python (or ruby, or whatever else that is high-level and easy).

    It's the same as basic was twenty years ago, just much more powerful, easyer to learn and more fun.

    • Re:python (Score:5, Funny)

      by Malekin (1079147) on Tuesday July 22, @06:12AM (#24286549)

      Forbid him to learn python. Then he'll do it himself to spite you.

      • Re:python (Score:5, Insightful)

        by xalorous (883991) on Tuesday July 22, @06:12AM (#24286551) Journal

        Dude, this guy's kid looks up to him, as a role model. The number one reason he wants to program is because his dad does it. By all means, give the kid the tools he needs to learn to program. Pick a language with lots of tutorials and books and wide acceptance (C or Java perhaps?). Get him to draw flowcharts or write pseudocode (people still do that?). Give him some fun problems to work out. Go over code with him. Show him ways to improve his code and explain the reasoning behind them. His interest in spending time with you will keep him at it until he's hooked on programming itself.

  • Write a game (Score:5, Insightful)

    by gsslay (807818) on Tuesday July 22, @05:21AM (#24286179)

    Write a game, perhaps based on a favourite book. Or something that involves a subject he's already interested. Doesn't matter if it's a simple text game. Let him write it on his own. Then when he's finished suggest a few improvements. Repeat. Once he's bored with that, start a new project.

    That's how I learnt.

    And for pity sake, do not ask him to kernel hack. It's way too abstract. You need something user-level with immediate and very visible results.

    • Re:Write a game (Score:5, Interesting)

      by Anonymous Coward on Tuesday July 22, @05:33AM (#24286259)

      I'll second that. Many of us learned on 8-bit home computers, where you could understand everything that was going on, and we made games. Brilliant self education.

      The best way of doing that now is with the Hydra console [xgamestation.com]. The hardware is completely documented and described at the beginner level in the book. And there is no OS or APIs to deal with, disguising what's really going on. You code straight to the bare metal.

  • by blahplusplus (757119) on Tuesday July 22, @05:26AM (#24286225)

    C++ primer plus by stephen prata.

    http://www.amazon.com/Primer-Plus-5th-Stephen-Prata/dp/0672326973/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1216718603&sr=8-1 [amazon.com]

    It is one of the best ways to learn programming from absolutely knowing nothing! Because it explains in very accurate, precise and simple language that is very well expressed.
    This is where I learned to program years ago, and I'd challenge anyone to find a better place to bring an absolute know nothing about programming into the fold.

    It explains all the simple functions and whatnot for console programming, etc, if he can't dig that then he's not fit to program, the book makes C++ as easy as something as python, or the old visual basic.

    The old visual basic 6 is not a BAD place to start if you can find some good programming books, because the old VB gave "immediate" results that kids often look for.

  • Solving problems (Score:5, Insightful)

    by Yetihehe (971185) on Tuesday July 22, @05:35AM (#24286267)
    Show him how he can solve some simple problems for school, so he can later try to solve some more complicated problems. I have started this way when I was 12.
  • NetHack! (Score:5, Insightful)

    by ThePhilips (752041) on Tuesday July 22, @05:42AM (#24286303) Homepage Journal

    Give him nethack (or any other OSS game) to play. After a while when he will get interested - give him the source code for it.

    Programming games is probably most engaging activity. I'm 31 now - but still on it ;)

  • by IBBoard (1128019) on Tuesday July 22, @05:43AM (#24286311) Homepage

    The best language to teach him is $trendy_language_of_the_moment. If you don't teach him that then he'll never get anywhere. How can people hope to encourage people to learn when they're using $formerly_trendy_language? It's just so horrible that I'd rather gouge someone else's eyes out with a spoon that use it instead of $trendy_language_of_the_moment!

  • by shaka (13165) on Tuesday July 22, @05:46AM (#24286335)

    First off, I think you should start with a language such as Python or Ruby. I started with BASIC which was easy to grasp, and more modern languages are easy yet more powerful.

    Second, when I started programming I was first looking at my brother, writing really simple BASIC programs on the C64. Later, I was interested in fractals and wrote algorithms for drawing fractals. I had a book with code examples for different fractals, but in some other language (I don't remember which). The process of interpreting the algorithm in the first language and translating it to BASIC was very good for learning. Tweaking and extending the algorithms and seeing the changes visually was very encouraging.

    Today, if I were to teach a kid programming, I think I would look into Lego Mindstorms [lego.com]. It helps if the kid is into Lego or robotics, of course. That's a contained environment with a powerful and easy language, which is also part of something else, with immediate feedback on the changes. You can program it in either the Lego-supplied RCX Code (BASIC-like) or ROBOLAB (LabView-based), or any of a number of languages supplied by the community (C, C++, C#, Java, Lua etc).

  • by Anonymous Coward on Tuesday July 22, @05:47AM (#24286339)

    That's THE way to get ANY teenager to do ANYTHING.

  • Personally (Score:5, Insightful)

    by ledow (319597) on Tuesday July 22, @05:49AM (#24286357) Homepage

    I don't see that not having a flashy GUI means anything. I grew up in a world where I saw flashy GUI's for exactly what they were. I was much happier hacking DOS to get that extra few KB of base memory than I was playing about in Windows 3.1.

    The problem is that you can't foster curiosity, which is the main driver here. Nothing will make you sit down and learn a programming language more than curiosity for what you can make the computer do, whether you can do something better than Microsoft, etc. You can try very hard to keep interest, though, and there practical results tend to have greater effect - this is why most basic ICT in schools is based around roaming turtles, Lego RCX, "traffic-light" kits etc. Computer-controlled with visible, physical effect.

    Personally, I think the best way to foster the right computer skills isn't to use a computer much at all (this is a philosophy I've held for most of my life - the best way to program is in your head, not a machine - the best way to write a story is on paper, not a word-processor, etc.). The best things to use to learn are simple gadgets. I'm not a gadget person. I'm not even very good at electronics but I struggle along and get a lot done.

    Wire your house for a burglar alarm, controlled by a computer, and involve your children in every step. If your practical skills aren't up to scratch (good, you can "learn" by your mistakes together and your child can try to "out-think" you when you both hit the same problem), you can get X10/DMX-style equipment that makes it a cinch. But there's nothing like a bug that'll scare the crap out of you when the alarm goes off because you didn't cater for a niche-case (opening the back-door while the power was out etc.). It only needs an ancient "sacrifical" computer that doesn't matter if you blow its parallel port, and it introduces every single reason behind having computers - automate tasks that a human could do using simple, cheap components.

    You can learn programming, you can learn embedded programming, you learn about the importance of bug-checking and clean code, you learn about interfacing, buses, serial/parallel data transfer, physical and real-world effects and how to counter them in software (e.g. switch debouncing). You even get to learn how the damn computer does its job so that it's no longer a magic box that does stuff. You get to interface with all types of cool gear. You get to bring practical, real-life skills into the learning environment which can help immensely if your child learns better that way. (And I don't count "how to write a letter in Office", I mean REAL life skills, like practical problems, electricity and electronics, wiring, why the bloody ladder won't stay still and why Daddy put his foot through the roof).

    The rewards are instant, visible, practical, extendible and "show-off-able". The "reward" of having the whole family laugh at a a doorbell that plays a WAV when someone presses it is very rewarding especially when "it was all my son's work". My particular favourite is a doorbell that goes "knock knock" when you ring it. I also bought an old-fashioned door knocker which has an integrated switch in it and want it to set off a "ding-dong" sound, just to see the postman's face. I'm doing it with simple electronics and one of those recorable greetings-card chips but you can do it with a PC easily. Ten minutes of very basic wiring to an old-fashioned joystick port (ancient laptops are great for this sort of thing), a WAV file off a free website and a twenty line program. You can see exactly where his skills lie. Is he a better programmer? Is he a better thinker? Is he better at practicalities? But no matter what he is, it's so simple to do that you can have great fun wiring it up (probably with Mum in the background tapping her feet because she's getting sick of "Yankee Doodle" every time the neighbour's call).

    Then you need to get to the point, as quickly as possible, where he can *think* of new stuff to do himself. You started with a doorbell

  • My experience (Score:5, Interesting)

    by mtxf (948276) on Tuesday July 22, @05:56AM (#24286407) Homepage

    I started programming when I was about 12, and I am completely self taught. My parents knew nothing about computers, and still know nothing now despite my efforts. Anyway, i started with javascript, html, and php. (This was around 6 years ago). I think it was much easier to start learning the basics of this kinda stuff when you don't have to deal with all the boring (to a 12yo) details of memory management, libraries, and compilers etc. Web programming is something were you can get the instant results and action, you can just keep tweaking the source file and hitting F5 until you get something that works and looks vaguely like what you're after; this is especially useful when you don't know what you're doing. :)

    I had a few books which taught me the basics, a javascript book and a html book. They only covered simple things, (I think the js book was a For Dummies..., actually), but it was enough to get me started. After that I found the php.net docs and a friend showed me loads of his php code and i picked that up fairly quickly.

    Being a website, it's something easy to show off too, it was kinda cool to be like "dude, the whole world can see my webpage!". Following that theme, i got started on irc bots, eggdrops are written in C, and you can script em with tcl. Be careful tho, tcl is kinda quirky and weird (at least, that's how i remember it). But it's great for simple stuff, get the bot to parse some text and reply etc. This might also be a good time to learn some networking stuff. Also since eggdrops can also have C modules written, this is a possible path into C, although I didn't go that way so I don't know how good it is.

    I eventually learned C(++) from some online tutorial, http://www.cplusplus.com/doc/tutorial/ [cplusplus.com] I think. And I wrote a load of code for manipulating some large binary files (game resource files, from Halo). I certainly don't recommend letting anyone learn C solely from some tutorial, since I had rather large gaps in my knowledge at this point (that code i wrote is terrible), but it was some great experience anyway. I played around with some .NET (ugh!) gui stuff, because I didn't know how else to make a gui program at the time (seriously, I don't know how I was meant to know about qt, gtk, or win32 etc at this point) and a program that just prints text on the command line got boring real fast.

    Hacking at computer games was what really drove my interest in C at that time. Reverse engineering of the file formats was fun! Even if I did kinda suck at it and just found most of the info on the web.

    Looking back, I'm thinking I probably would have liked someone to show me python (and maybe perl) much earlier than when i eventually discovered them. php sucks as a general purpose scripting language and C gets tedious for those little tasks.

    Sorry that was all probably a little incoherent, I spent the time I was meant to be doing english homework programming ;)

  • by Chineseyes (691744) on Tuesday July 22, @05:59AM (#24286431)
    Don't try your to encourage your child to do anything for which they don't have a natural inclination, they will end up hating anything you try to push them towards to forcefully. Give them a well rounded education and make programming one of many things you expose them to, this was what my parents did and I am thankful for it. I lost count of how many people I met in college whose parents had enthusiastically encouraged them to learn one topic or another, especially the children of professors. Some people took off with whatever topic their parents introduced to them but most of them ended up switching majors 4 or 5 times and spending years and many dollars on undergraduate education. Demand excellence in whatever your child has interest in, with the caveat that as they get closer to 18 they have a plan on how they will feed themselves (so you want to be an actor Johnny? Great, better double major in something practical otherwise you'll be waiting tables cause I won't be paying your bills).
  • I've often found that by far the best way of teaching him to do this kind of thing relies on finding something he wants his computer to do for him.

    This could be just about anything - if he likes sports, it could be a sports results and stats database, if he likes RC modeling it could be an interactive application for setups for his radiocontrolled cars. Your only real role here is to ensure he chooses something feasible in a reasonable timeframe (don't suggest writing Quake5 :) )

    The thing I like about this approach, is that it will teach him far more than just "how to do it" - you can start it with a discussion about how he wants to go about it, to start with which language (pros and cons, quick GUI development vs. old school stuff - basically just see what ticks his boxes) and it'll then take you through the basics of data models, and the fact it'll be useful will keep him motivated. Help him break the task up into little bits, and use the first few to teach him the ropes, and then let him try some on his own.

    Make it clear it's his project, that you're there to help whenever and wherever you can - but don't judge. If he wants to start with an Access DB - by all means point out the pros and cons, but it's his toy - let him do it, he should be old enough now to see for himself whether it's "right" or "wrong".

    • Perhaps, but there are many elements to programming some of which are perhaps easier to learn than others. Teaching his son to program may benefit from being able to distinguish these elements. My initial suggestion would be to give him Python because this will let him learn the critical elements of program structure and algorithms without getting bogged down in learning the idiosyncracies of a language like C++ (which I do love). For similar reasons, Python will also offer fast return on investment. He'll be churning out programs that do what he wants them to in half the time he would be in C++ or Java.

      Of course the most important thing is probably to let him drive the learning for the most part. If he's a bright and technically minded lad, he may appreciate the power and intricacies of C++. He'll need the language sooner or later if he gets involved in many of the big open source projects which would also be a great way to get involved. Things are usually more fun when done as part of a group.
        • Re:No ShortCuts !!! (Score:5, Informative)

          by hobbit (5915) on Tuesday July 22, @06:26AM (#24286651)

          I'll feed the troll today.

          So he can learn how important white space is

          Indeed. Unlike most other programming languages, Python mandates readability, which is an excellent discipline for a youngster to learn.

          and write entire apps with a single line of code

          This is possible in most languages, but somewhat less likely in Python owing to the aforementioned discipline.

          and no idea how it happened

          This is impossible in most languages, and Python is no exception.

          and learn to program with no job prospects?

          You just keep telling yourself that; the world will change around you.

          I have nothing against Python

          In that case you need to brush up on your writing skills.

          but as a learning language I put it down there with Perl.

          A lot of people cut their teeth on Perl. I am not one of them, so I can't comment.

    • by D'Sphitz (699604) on Tuesday July 22, @05:52AM (#24286381) Journal
      Nobody starts out with kernel hacking. Kernel hacks are bragging rights for adult geeks, sweet myspace pages and guild websites are bragging rights for teenagers.

      Teach him some PHP and HTML, or if you're an elitist teach him Ruby, or if you're a sadist teach him Perl. Teach him some JavaScript and Flash and Photoshop, and then let him go do the things that will impress his friends and therefore hold his interest, like rickroll pages and guitar hero videos.

      If he's really into it the serious stuff will follow naturally in time, no point in intimidating him right off the bat.
      • by montyzooooma (853414) on Tuesday July 22, @06:00AM (#24286447)

        Yep, if he doesn't have the drive to learn programming on his own he never will.

        Is that really fair? When a lot of us started programming every home computer had a built in version of Basic (or Forth if you had a Jupiter Ace... you lonely lonely soul...) so jumping in wasn't too hard when the first thing you looked at after bootup was the Basic interpreter.

        • by Swizec (978239) on Tuesday July 22, @06:17AM (#24286591) Homepage
          For most people programming is a long road of breaking your head against a problem until it gets solved. Long hours spent tapping away at the keyboard and honestly "normal" people think we're all out of our minds.

          So no, if he doesn't have the drive to learn and problem solve he's better off outside playing with a ball ... or girls since he's a teen.

          I didn't mean that he's gonna have to learn programming himself, guidance is awesome to have, but the really good programmers out there are mostly self taught, people who were able to absorb knowledge wherever it came from, be it a peer, a book or an actual teacher. The ones who were "taught" programming are code monkeys with a very limited ability of actual programming, sure they can code, but they can't Code. If you catch my drift.
    • by SimHacker (180785) on Tuesday July 22, @06:32AM (#24286699) Homepage Journal

      There are so many reasons not to start with PHP, that I'm not even going to start listing them here. PHP is a HORRIBLE first language, and a horrible second, third or forth language. It corrupts minds, and makes it harder to learn other languages. It's a lot worse than corrupting someone by teaching BASIC as a first language.

      You should be ashamed of yourself for suggesting teaching PHP to a kid.

      -Don