Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Programming IT Technology

How To Encourage a Young Teen To Learn Programming? 1095

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?
This discussion has been archived. No new comments can be posted.

How To Encourage a Young Teen To Learn Programming?

Comments Filter:
  • by Corporate Troll ( 537873 ) * on Tuesday July 22, 2008 @05:16AM (#24286161) Homepage Journal

    Your approach is still correct. The point and click gives results fast, but doesn't actually teach you anything. If he find the basics, boring, don't even bother anymore. Programming isn't for him.

    Heck, I can say that programming for me became boring the day I started doing it professionally. I would rather direct my son in a completely orthogonal direction.

  • Write a game (Score:5, Insightful)

    by gsslay ( 807818 ) on Tuesday July 22, 2008 @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.

  • by h4rm0ny ( 722443 ) on Tuesday July 22, 2008 @05:31AM (#24286249) Journal

    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.
  • Solving problems (Score:5, Insightful)

    by Yetihehe ( 971185 ) on Tuesday July 22, 2008 @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.
  • by Destrius ( 956 ) on Tuesday July 22, 2008 @05:35AM (#24286269)

    Being able to produce pretty pictures is always fun. I learnt programming by spending all my time drawing bouncing balls that changed colour in 320x200 VGA. Of course nowadays kids can use a lot more powerful graphics libraries like the aforementioned SDL, which can let them make a lot cooler stuff.

    If he gets the hang of it, you could even teach him how to write a raytracer. That would also be good for his math, and be a nice project where more advanced programming techniques (e.g. data structures, recursion) and more advanced math (calculus, 3D geometry) have practical uses.

  • Javascript (Score:2, Insightful)

    by dgun ( 1056422 ) on Tuesday July 22, 2008 @05:39AM (#24286279) Homepage

    Javascript is not really a best first language to learn, I don't suppose. But my teenage son was more interested in it than in the C 'hello world' example I showed him, because he was familiar with web pages and web browsers and he could immediately see the implications.

    My guess is that if you do a simple script that moves something around on the screen and then let him play around with it some, that this will spark his interest.

    Good luck

  • Re:Games (Score:3, Insightful)

    by aero2600-5 ( 797736 ) on Tuesday July 22, 2008 @05:40AM (#24286289)
    I have to second this one. I got hooked on programming in high school in a class where we had to program robotic Lego sets to do specific things using BASIC. Regardless of what you use to interest him, I would avoid projects longer than 3 months. If kids work at something too long without any reward, they're likely to lose interest.
  • NetHack! (Score:5, Insightful)

    by ThePhilips ( 752041 ) on Tuesday July 22, 2008 @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 ;)

  • Re:NetHack! (Score:3, Insightful)

    by ThePhilips ( 752041 ) on Tuesday July 22, 2008 @05:43AM (#24286309) Homepage Journal

    btw, there are bunch of games written in Python using PyGames framework. That to me sounds definitely as good idea. Using PyGl you can also utilize 3D things.

  • by shaka ( 13165 ) on Tuesday July 22, 2008 @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, 2008 @05:47AM (#24286339)

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

  • How about Logo? (Score:3, Insightful)

    by nithinsujir ( 592733 ) on Tuesday July 22, 2008 @05:49AM (#24286353)
    I think logo was my first programming experience and I enjoyed it. It's great to see the fruits of your labor instantly in graphical form.
  • Personally (Score:5, Insightful)

    by ledow ( 319597 ) on Tuesday July 22, 2008 @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

  • BASIC + graphics (Score:1, Insightful)

    by Anonymous Coward on Tuesday July 22, 2008 @05:50AM (#24286363)

    I started learning programming with QBASIC (on my own, wth some help from google).

    It's simple to understand (a kind of...), and if you show him some the graphical stuff (different resolutions, on text mode, graphical mode) it think will be courious to learn. (make sure that your windows/dosbox emulator supports that graphical modes)

    At first some "Guess a number" (with the output from the computer "lower"/"higher"/"right" or "cold"/"colder"/"hot"/"burning").
    Next maybe a pong game (but be attent at the geometry/phisics stuff, which may be a bit hard if he's so young) or a simpler space invaders, or even a tic-tac-toe (with random chooses, later a very weak AI).

    anyway, keep it simple!

    (Bonus points if he knows about text-mode games like nethack or will code a "Hunt for Wumpus")

    (Posed as AC beucase I don't have an account here)

  • by D'Sphitz ( 699604 ) on Tuesday July 22, 2008 @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 Chineseyes ( 691744 ) on Tuesday July 22, 2008 @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).
  • Re:python (Score:3, Insightful)

    by Eudial ( 590661 ) on Tuesday July 22, 2008 @05:59AM (#24286437)

    I second this. most folks I know who love programming learned a nice easy language as a kid (BASIC in my case, a long while back). Python is easy enough to learn how to program in, but flexible enough to draw stuff on the screen, play sounds, talk to remote machines - mess with what the machine is capable of.

    I'd definately pick a friendly language to begin with (and I'm not sure C or C++ fit that bill, I'm still learning good C++ practice after a decade of commercial use).

    What you choose as a first language matters. It should be easy, and teach basic flow control in a very direct matter that allows for an intuitive understanding of those subjects (BASIC was the name of the game when I was young, python is where you'll want to go today). But I'd definitely leave the door open for C or C++ as well (hell, I learned C when I was 15). Buy a good book on python, and K&R to teach him C, and tell him to start out with python, and get into C if and when he feels like it.

    It's also good not to micromanage too much.

  • by montyzooooma ( 853414 ) on Tuesday July 22, 2008 @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 Dean Edmonds ( 189342 ) on Tuesday July 22, 2008 @06:03AM (#24286487)

    Whether you teach him programming or someone else does, the most important thing you can do for him is to show your enthusiasm for programming and demonstrate why you love it. Those kinds of things are infectious. If he catches the bug then he'll learn it, one way or another.

  • by aembleton ( 324527 ) <aembleton@NOSPaM.gmail.com> on Tuesday July 22, 2008 @06:10AM (#24286535) Homepage

    You need to show him something that will quickly show results, preferably something that can display a UI and I guess these days that would be best done via a web browser. Try to teach him some PHP so that he can quickly see the fruits of his work on the web, and from there move to Javascript, mySQL, and then to AJAX. With that knowledge teach him to learn for himself by developing a facebook application by reading the facebook api and going from there. From there you can move him onto some of the C/Java code at which point he should have a strong understanding of the logic and will have picked up some useful SQL skills.

    Quick results are what got me into programming. Seeing that I could code a small, higher or lower game in about 10 mins for the BBC Micro or an Acorn and then show that to anyone who was interested was almost instant gratification. These days a web based project would be more impressive and easier to distribute.

  • Re:python (Score:5, Insightful)

    by xalorous ( 883991 ) on Tuesday July 22, 2008 @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.

  • by Swizec ( 978239 ) on Tuesday July 22, 2008 @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.
  • Re:python (Score:5, Insightful)

    by silentcoder ( 1241496 ) on Tuesday July 22, 2008 @06:28AM (#24286659)

    >I'm still learning good C++ practice after a decade of commercial use
    Don't worry, so is Bjarn Stroustrop

  • by donaldm ( 919619 ) on Tuesday July 22, 2008 @06:30AM (#24286681)
    You are right there are no short-cuts although I would suggest he become familiar with the basics of using a *nix system such as how to use the command line and why this is still preferred for certain tasks. This is not to say that GUI should be disdained but you should be able to point out when a GUI is the best solution to a problem and also when the command line may be the better way to go.

    Now to programming. It is easier to explain the basics and it is very easy to show by example (keep it simple at first and let him get comfortable) if you use the shell (ie. bash, ksh or just sh - there are others but ksh/bash/sh are the most common) as a basic introduction to programming. You can later on get into languages like Perl and eventually C although I would recommend a formal course on the basics of programming before any he tries to learn a language that need to be compiled. As to more advanced languages it is very difficult to recommend one since the choice of a language should depend on what you as the programmer want to achieve, although as you probably know you may not have any choice in the matter.
  • by SimHacker ( 180785 ) on Tuesday July 22, 2008 @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

  • by Dersaidin ( 954402 ) on Tuesday July 22, 2008 @06:33AM (#24286717)
    Don't teach him anything.

    Provide him with a computer. Provide him with help when he asks (or not, figuring things out yourself is best).

    Show him how useful it can be to write programs to make the computer do whatever you want.

    If he wants to learn, he will. If not, bad luck.

  • by moshez ( 67187 ) on Tuesday July 22, 2008 @06:41AM (#24286761) Homepage

    Teach him JavaScript.

    Set up Firefox and Firebug, and you have a wonderful console for programming right from the browser. You can do fun animations, effects, and various cool things.

    And showing it to friends is as easy as uploading to a host...

  • Re:My experience (Score:3, Insightful)

    by codeButcher ( 223668 ) on Tuesday July 22, 2008 @06:46AM (#24286807)
    Oh, and remember that until you kick him out of the house (or at least to the basement), his job is to play, not work.
  • by OpenSourced ( 323149 ) on Tuesday July 22, 2008 @06:46AM (#24286809) Journal

    When I was 15, I had never seen a computer, but I knew that I wanted to work with them. The _idea_ of computing, of writing instructions to make the computer do what I wanted, of playing with something that exhibited some of the powers of human mind, was terribly interesting to me. Getting my hands on my first PC, a thing with a BASIC interpreter and graphics! display in a TV monitor, was an intense experience, even if I cannot say why, what clicked inside me. The making of my very first BASIC program, unaided, reading a manual in a foreign almost-unknown language (English) was a triumph. The making of a program that draw a circle on the screen by calculating the distance to the center, was making mathematics come alive for me for the first time.

    What I mean is that, in my case, no stimulation was needed, and probably difficulties just added emotion. The interest and emotional attachment to the computing world was immediate and intense. I don't know if I'm a typical case, but my anecdotal evidence is yours for what's worth.

  • Re:Write a game (Score:3, Insightful)

    by Jesus_666 ( 702802 ) on Tuesday July 22, 2008 @06:56AM (#24286891)

    If the GP's teenage son is really interested in learning programming perhaps a small microcontroller project would be a good place to start. PICs and AVR cores are quite simple to implement and program. Investigate a development kit instead of diving into programming the PC.

    If he's also interested in electronics you can get a small Atmel and the neccessary components and build your own Lego Mindstorms workalike. Low-level programming and electronics sure sound interesting to a geeky kid if they allow him to build his own autonomous robot. Plus, he learns how to use a soldering iron, a skill I would dare call essential.

  • MOD PARENT UP (Score:3, Insightful)

    by Asmor ( 775910 ) on Tuesday July 22, 2008 @06:56AM (#24286895) Homepage

    Javascript was my first programming language. It's something everyone's got simple access to, it's very forgiving (though it does set you up for some bad habits), and it's very simple to make GUIs and interact with the user.

  • by OrangeSpyderMan ( 589635 ) on Tuesday July 22, 2008 @07:11AM (#24286997)
    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".
  • by Moraelin ( 679338 ) on Tuesday July 22, 2008 @07:40AM (#24287213) Journal

    While I'll aggree that kernel hacking won't get anyone interested in programming, I think programming web sites is somewhat lacking in motivation. As you were saying, you want it to provide some serious bragging rights.

    Whatever you want to do on the web at teen level, has been done before and better. Publishing photos? There are a ton of providers which achieve the same thing. Forums? Ditto. All you need for a good guild web site are webmaster skills or maybe graphics design, _not_ programming. Approaching it from the programming side is the way to get the least bragging rights, with the most effort. Everyone won't go "woot, what an original forum you programmed!", but the more discouraging, "geesh, why don't you use PhpBB like everyone else?"

    Personally, looking back at what motivated _me_ back then, I'd say start with games. That was my motivation. I could throw together a game as good as Psion and the gang made for the ZX 81 and later ZX Spectrum, and show it to my classmates and get some serious appreciation. The first game I wrote, when I invited a couple of classmates to see it, they ended up playing it all afternoon. Mind you, it was uber-simplistic by today's standards, but it was as good as anyone could possibly do on a 1K ZX-81.

    It was motivating enough to get me started on assembly and converting it by hand to hex.

    Nowadays I wouldn't advise anyone to write a game from scratch at home, but there's a _lot_ you can achieve as a mod. And mod-friendly games are getting rather common these days. I can think of a few where most of the game logic (i.e., minus the graphics and such) was Python, one even TCL, and one was scripted in Java.

    So basically I'd say, show the guy how to make his own mods. Even if it's just for cheating it's a start.

    And the distant carrot of making it big and famous is there too. Both Counter-Strike and Team Fortress started as mods, and ended up major successes.

  • by hyades1 ( 1149581 ) <hyades1@hotmail.com> on Tuesday July 22, 2008 @07:42AM (#24287243)

    ...you're his dad. The time you spend with him will be one of the highlights of his life, and will determine how he, in turn, raises his kids. Whether you suck as a teacher or not isn't even on the scale. Try to learn. Do the best you can and encourage him to let his interests take him to other sources. ALWAYS answer his questions.

    Sorry for the polemic, but believe me, your son will stretch himself to understand you far more than he will even for the most gifted teacher. What I owe to my parents can never be repaid, and there isn't a day goes by that I don't miss them.

  • by jank1887 ( 815982 ) on Tuesday July 22, 2008 @08:10AM (#24287461)

    heh, he said orthogonal

    I would recommend you pick up some sort of embedded logic kit. Something, anything, that translates code into real world manipulation. Even if it just winds up being a fancy digital clock kit, the fact that he can write some code and see something physical happen can completely enamor a kid.

    I'm saying this from the perspective of an engineer. Circuit theory class was one thing. But when we could controllably vary the intensity of a lightbulb, and then in digital logic class pattern an LED array, and then in electronics move a robotic arm... etc. Things like that made the theory 'real'. Simple algorithms in a microcontroller producing sensible output can help make programming more than just words on a screen.

    I'm a bit out of touch with what's available, however. I know there are a number of LEGO kits (mindstorm or something?) that let you do things like this. Get a starter kit, give the kid a challenge, and tell him if he accomplishes 'X', you'll buy him a bigger set.

  • by twistedsymphony ( 956982 ) on Tuesday July 22, 2008 @08:13AM (#24287489) 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 ...

    I know at least for me the DRIVE comes from the desired destination... My advice for the fellow in TFA is to have his son pick a project. Start with something simple.. maybe it's just a slideshow or a tick-tak-toe game. Then start building it. Guide him a bit in the basics but encourage him to learn how to search for solutions that are beyond his knowledge. Once you have a basic program built start adding features.

    Maybe it's just because I'm partial to this but consider getting a few microcontrollers and teaching him to program on that platform. Writing something that interacts with a mouse keyboard and monitor on a computer is one thing... making something where you physically assemble the hardware as well is something else altogether. This will also test the waters in other tech areas... maybe he decides that he doesn't like programming but loves electronics, or maybe he like them both and wants to get into computer system or robotics.

    But seriously... just pick a goal, and work towards it... the best way to learn is though experience.

  • by eonlabs ( 921625 ) on Tuesday July 22, 2008 @08:13AM (#24287491) Journal

    I can't vouch for python because I haven't learned it yet, but the gist of the parent is dead on.
    Show him a prototyping language. Something he can dev in quickly before diving into the deep and mucky bowels of pointers, references, mixed languages, and memory management. These things are not obvious to a novice programmer, and program flow is far more important to pick up early on than that.

    I KNOW I'm going to get flack for this, but many people I know who are excellent programmers cut their teeth on QBasic. This language was simple enough to pick up that you could really get coding some complex stuff in under an hour. I would recommend text parsing stuff as a first thing. "Can you pull the hours out of the time?" or "Can you print in words what the date is from the seconds since...". This can be extended to stuff like "calculate Fibonacci numbers" and then teaching how to clean that code up. This is a good time to teach stuff like "code first, optimize second" and how to time code for optimization.

    It's also a good time to get him into commenting the code. The way I usually get newbies started on that is to have them write pseudo code or explanatory text before coding, using the comments as a guideline to keep them on task.

    If I were to suggest an order of action, try variables & output, input, conditionals, loops, complex conditionals (switch/select statements), objects, collections (sorting searching and maybe memory management here). It's hard to do GUI stuff off the bat because for c/c++ there are so many different flavors available that you can't say "This is how this is done" and be done with it. What might be a good approach is to have him build a game. Start with a MUX and evolve it to a side scrolling platformer, and then to one with 3D graphics (can still be side scrolling, but this way it at least gets flashy).

    It's really important to show how to make a responsive program early on. It's a lot more interesting to work with something that can give you feedback in some way. Even a lexical parser could be fun. Find the verb in the input sentence.

    When you've done all that, try implementing low level c/c++ code like the String class or Vector class.

    Python might be a good way to go, if it really is just print "Hello World" and you're done.

    Don't forget:
    import antigravity

    PLAY

  • by dargaud ( 518470 ) <[ten.duagradg] [ta] [2todhsals]> on Tuesday July 22, 2008 @08:31AM (#24287651) Homepage
    I don't usually write flaming posts, but C++ as a teaching language ?!? You are smoking crack. It has the worst and most complex syntax of any language ever invented. Even Brainf*ck has a cleaner syntax than C++.

    Wanna teach a language, then take one that's both interpreted and compiled like Python, Lua, Ruby. Take something that is radically efficient like Erlang or OCaml. Take something that is meant for teaching like Logo.

    But C++ ?!? Hah, why not Perl, then !

  • Effing Magic (Score:5, Insightful)

    by Keeper Of Keys ( 928206 ) on Tuesday July 22, 2008 @08:44AM (#24287779) Homepage

    You've hit on something there. I started messing around with computers when I was 12, and got such a kick out of getting them to do the simplest things, like print messages on the screen. And I can't say the thrill of getting one of these dumb lumps of matter to do what I want it to has never really gone away.

    I think Python would be an excellent starting point, but the language I would choose for a kid's first taste of programming is javascript. They're already familiar with browsers, and within seconds they can be bossing one around, leveraging all its graphical power.

  • Re:Son? (Score:5, Insightful)

    by sjs132 ( 631745 ) on Tuesday July 22, 2008 @08:45AM (#24287785) Homepage Journal

    There are girl geeks... Few, but some... So you can't assume your % of woman / water, it could have been % of male / water, etc..

    Off topic, but...

    One GG that I know, and is rather pleasant to view, decided the biological ticking was too loud. Having not found a suitable male after being hurt/rejected a few times, she decided to completely forgo the male part of the equation. A few Dr. visits, lots of $$ for fertility drugs, and some frozen sperm = twin babies on the way, no father needed.

    Now, in reality, a male was the initial donor of the frozen sperm, and I told her that she could of saved a lot of money by just going to a bar and drinking a lot of vodka, but she went on spouting about genetic core, family traits, selectability, et al...

    I almost wanted to point out the story of Dr. Jacobs [nytimes.com] who was convicted of fathering children with his own sperm instead of the donor sperm that was selected, but figured that would only cause too much angst.

    BTW, I guess this is becoming a trend among some women today, so the available men better figure things out soon, or the next generation will all be wearing "popsicle"(tm) T-shirts... (I'm out of the game, married with 2 kids myself, so don't blame me.)

  • by Keeper Of Keys ( 928206 ) on Tuesday July 22, 2008 @08:47AM (#24287807) Homepage

    It was quite a bit faster, though. And you got to learn FORTH rather than bloody BASIC.

  • by IamTheRealMike ( 537420 ) * on Tuesday July 22, 2008 @08:51AM (#24287851)

    That's not "writing them off", that's being realistic.

    When I was a teenager learning to program, I wanted to write video games. And I did. It was my first exposure to open source - a Delphi 3D MMORPG project. It was hopelessly over ambitious for our little team but it was fun, and taught me a hell of a lot about programming. And actually the maintainer/founder of that project went on to work for Ubisoft, so it worked out OK for him.

    Now the problem is that writing video games is actually pretty hard. Writing simple web apps is much easier. It also has the HUGE benefit that you can show your friends. I was very rarely able to show my friends what I'd written but when I did, it was a great feeling, because my friends intuitively understood that making a 3D world was hard.

    So I think writing web apps is not a bad place to start. The main problem is that web apps aren't video games, and all teenagers want to write video games. If our kernel hacker isn't too hung up on Freedom, I'd strongly recommend getting an Xbox360 and setting him up with the XNA framework. It's very much oriented towards hobbyist and beginner programmers.

    There are lots of tutorials, you write software in C# which is straightforward enough for novices but won't limit him, and the result can be uploaded to XBox Live or played when his friends come round. Importantly, it looks a whole lot more cool and professional (imho) if your work is running on a real games console.

    There is also a full, free 3D engine available (TorqueX) which can help him get started with writing simple 3D games without needing to master trigonometry and Direct3D. Back when I was doing this stuff, you had raw OpenGL or Crystal Space if you used C++ and were feeling brave.

  • by Floritard ( 1058660 ) on Tuesday July 22, 2008 @09:41AM (#24288445)
    I dunno though, do many teens even like 2D side-scrollers? He probably grew up on Playstation. I was going to say go ahead and get him going on some OpenGL. NeHe's tutorials [gamedev.net] really make it pretty easy to get into. Of course he's be using C++ so maybe something easier.

    Graphics is what got me interested in programming. I remember my high school Pascal classes. Unfortunately they were pretty boring. We did do some simple EGA graphics at one point but that was really the only interesting thing we did in class, though I did end up learning the fundamentals.

    Thing was, to do anything cool you had to do all this VGA initialization stuff that was forever out of our reach at that level. Not to mention the computers were pretty obsolete even at that point.

    I know there's a lot of (mostly unreasonable) hate around here for Flash, but I'd say get him into Actionscript3. It's really easy to do graphics in without having to setup windows and rendering contexts or getting to know huge APIs. It will introduce him to object oriented programming, but won't involve pointers or memory management or any of the more esoteric aspects of something like C++. Another thing is he can easily share whatever he produces with most anyone else who has a browser. If he is at all into social networking online (all that myspace bullshit) he can make some pretty interesting stuff for his friends' pages. Using Actionscript could also lead him to branching out into other web technologies, something probably more important in today's world than ever. It also has a similar syntax to Java or C++ if he wants to go in that direction. And as far as help and tutorials, there's really one of the richest communities around Flash, being a technology that was practically born in the middle of the blogging phenomenon.

    The best thing about Actionscript is how quickly you can put something visual together and how little setup it requires. Graphics is definitely the way to go, and nothing in programming has a more immediate "wow" factor than throwing something pretty up on the screen.
  • by dougwhitehead ( 573106 ) on Tuesday July 22, 2008 @10:31AM (#24289063)
    Get Lego Mindstorms and download Java for it, called leJos. That way his programs can start simple and still get real feedback.
  • by Culture20 ( 968837 ) on Tuesday July 22, 2008 @10:39AM (#24289159)

    driving a truck, or waiting on tables, or shuffling paper, or laying bricks [...] they're not exactly riveting

    Laying bricks is close (both construction), but nothing is as riveting as... riveting.

  • Re:Effing Magic (Score:2, Insightful)

    by minister of funk ( 123188 ) on Tuesday July 22, 2008 @10:45AM (#24289257)

    I've had many conversations with various peers around the question, "What do you think is a good first-language?"

    When I was first exploring computers, I was using Basic, Pascal and Logo. I don't remember Pascal, and I can't forget Basic or Logo. My first big passion-driven project was developing a Choose-Your-Own-Adventure engine in Basic. It got me into abstraction, simple databases, and eventually graphics.

    I think JavaScript is a GREAT learning tool. You can simulate writing to files using text areas or new windows and Firebug is an excellent debugging tool. The language is very approachable and forgiving. Maybe using a strongly-typed language as a first language encourages disciplines that are missing in new programmers, but inference-typed languages offer tremendous power and can lower frustration levels.

  • by h4rm0ny ( 722443 ) on Tuesday July 22, 2008 @10:53AM (#24289365) Journal

    There's a lot of very good advice here, but the most important of all is to listen to your son closely to see what interests him. For me, prodding away, I had a fascination with memory storage. Arrays in particular stunned me with their beauty and the first programs that I really applied myself to writing were strategy games that were at heart nothing more than 2D arrays that stored types of units, resources etc. Of course the units themselves were arrays. I might have been an odd child, but the thought of all those numbers lined up and structured absolutely thrilled me. Who knows what will really grab your son's attention? Well, actually, only your son does, which is why he most of all, is the one you should listen to.

    You don't have to be a great teacher when the pupil is interested. Just try to learn to answer questions at the right sort of level of detail. That's 90% of it when you think about it, it really is.
  • Re:python (Score:2, Insightful)

    by Anonymous Coward on Tuesday July 22, 2008 @01:38PM (#24291879)

    By all means, what the previous poster said. Spending time with your son is the most valuable gift you can give him, regardless of the language you think he should learn. Pick a language, buy a For Dummies book, and spend quality time with your progeny. Even if he decides that he hates programming after a year, he will still take away the time spent you as well-spent.

  • by IamTheRealMike ( 537420 ) * on Tuesday July 22, 2008 @03:47PM (#24293937)

    Dudes, don't bite my head off. Nobody ever said teenagers couldn't do kernel hacking, they said that shouldn't be how they are introduced to it. And that's totally right!

    Here are some aspects of kernel hacking from a beginners perspective (and really this is what it's about - being a beginner, not being a teenager):

    • Abstract: concepts like scheduling algorithms are way too removed from achieving useful results
    • Unforgiving of mistakes: Messed up? Time to reboot. This is amazingly frustrating for professionals, let alone novices.
    • Way too limited: kernels are written in C. C does not teach you modern software design, in particular, object orientation. Knowing this stuff inside out is crucial if you ever want to get a non-shitty job writing non-shitty software.

    Here are some attributes of video game programming:

    • Immediate: you can see the results of what you do.
    • Forgiving of mistakes: if you make a mistake, you get a backtrace showing where. You fix the problem and continue. Fast turnaround time on mistakes is crucial to learning.
    • Many possibilities for learning: even a basic video game will involve complex data structures, maths, non-trivial algorithms, file and network IO, designing data formats, user interfaces .... you name it, video games need it.

    Nobody is trying to insult you by saying teenagers should start with video game programming instead of kernel programming. Believe me, I'm 24 so it wasn't that long ago I was a teenager. After I finished with that video game I moved on and by 18 I was debugging race conditions in Wine. But doing that video game was some of the best experience I ever had - it let me practice object oriented design, high performance coding, memory management on a large scale, user interface design, OpenGL, and implementing complex algorithms like A* pathfinding.

  • by Anonymous Coward on Tuesday July 22, 2008 @03:58PM (#24294111)

    When I was a wee lad, I came across and read "Peter Norton Programmer's Guide to the IBM-PC". That book hooked me on all things PC.

    It detailed the intricate workings of the PC and the "revolutionary" concept of BIOS interrupts.

    Years later, when interviewing candidates for programming positions, I would ask them "When you press the letter 'A' on the keyboard, what happens ?". Their answer would usually be along the lines of "An 'A' shows up on the screen". I would then ask "Why?". If they were able to articulate anything better than "because", they would usually get the job.

    I'm now an old person, and I know my views of what programmers should and shouldn't be are probably dated, but I think the worst part about his latest crop of programmers is the total disregard for what actually happens at the machine level. This is what contributes to the crappy, inefficient and unintelligible code that we see being produced today.

    Imbue in your son the basics about what a computer is and how it does what it does, and you will be doing him a great favor if this is the profession he chooses to pursue.

    I am not advocating that every programmer needs to know how to write a BIOS and put it on an EPROM and replace the one they have in their computer, but at least know what the BIOS is and why it is so important in the grand scheme of things. Nowadays, people learn VB.NET and think they are gurus because they can make a form pop up on the screen. I'd like to see them dive into Microsoft DOS technical documentation and make heads or tails out of Microsoft's "List of Lists" to be able to recover data from an accidentally formatted hard drive.

    I'm ranting... just my two cents...

If all else fails, lower your standards.

Working...