Announcing: Slashdot Deals - Explore geek apps, games, gadgets and more. (what is this?)

Thank you!

We are sorry to see you leave - Beta is different and we value the time you took to try it out. Before you decide to go, please take a look at some value-adds for Beta and learn more about it. Thank you for reading Slashdot, and for making the site better!

How To Encourage a Young Teen To Learn Programming?

Soulskill posted more than 6 years ago | from the electroshock dept.

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?

Sorry! There are no comments related to the filter you selected.

Son? (0, Redundant)

Swizec (978239) | more than 6 years ago | (#24286151)

I thought geeks didn't have sex ...

Re:Son? (5, Funny)

Slimda (1329895) | more than 6 years ago | (#24286165)

I thought geeks didn't have sex ...

Geeks clone themselves, it provides the same benefits without all the hassle with bodily fluids.

Re:Son? (1, Funny)

Anonymous Coward | more than 6 years ago | (#24286201)

Just because you're a loser doesn't mean we all are, I hate to tell you.

Re:Son? (4, Funny)

Darfeld (1147131) | more than 6 years ago | (#24286429)

I know you're lying : you actually enjoy telling him.

No ShortCuts !!! (2)

Axe4ever (1155411) | more than 6 years ago | (#24286153)

Problem solving ability grows only by tackling small small challenges at first.Again, u build that ability by slowly advancing your level.Not to mention that, you have to burn out to really learn something. To write great code, you have to go through great code that others have written. In short,there are no shortcuts .

Re:No ShortCuts !!! (5, Insightful)

h4rm0ny (722443) | more than 6 years ago | (#24286249)

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 !!! (-1, Troll)

D'Sphitz (699604) | more than 6 years ago | (#24286439)

Why Python? So he can learn how important white space is, and write entire apps with a single line of code and no idea how it happened, and learn to program with no job prospects?

I have nothing against Python but as a learning language I put it down there with Perl.

Re:No ShortCuts !!! (2)

Swizec (978239) | more than 6 years ago | (#24286251)

Yep, if he doesn't have the drive to learn programming on his own he never will. I remember back in the day I used to go through Pascal's help index to find interesting new stuff to learn because what the teacher was teaching was simply way too slow and uninteresting for me.

In the same light, perhaps you should try the observing approach. Give him a problem that will pique his interest and just observe. Don't meddle, don't teach, wait until he gets truly stuck.

Re:No ShortCuts !!! (4, Insightful)

montyzooooma (853414) | more than 6 years ago | (#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.

Re:No ShortCuts !!! (5, Insightful)

D'Sphitz (699604) | more than 6 years ago | (#24286381)

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.

python (5, Interesting)

utnapistim (931738) | more than 6 years ago | (#24286157)

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 (3, Interesting)

Fingerbob (613137) | more than 6 years ago | (#24286207)

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).

Re:python (1)

jabjoe (1042100) | more than 6 years ago | (#24286305)

I third that. BBC BASIC was my first language, powerful and easy. Acorn users often used BASIC as a shell, and many Acorn apps where mostly written in BASIC with just the part needing speed written in ARM or C. Python is the modern day version of this. I'm so pleased to have a language for these uses again. (But relatively, python is isn't as quick as the super quick BASIC was on the Acorn (on the StrongARM it all fit in the instruction cache.))

Re:python (1)

KlaymenDK (713149) | more than 6 years ago | (#24286523)

Fourthed (Forth'ed?).

I started out with a Mac, Ansi Pascal v1.0, two reference manuals, and basically no other help. Today, I would hand out Python, and have regular talks -- not about programming, but about things that you could do with (simple) programs. Let the kid figure out his (oops, presume it's a he) own level, his own assignments. Stick in a challange or two along the way.

Re:python (1)

ethorad (840881) | more than 6 years ago | (#24286383)

As has been said, you need to get him to want to learn. For me, the thing in particular which did that was fractals. Being mathematically inclined I used to build programs to solve problems, but the thing which spurred me on was drawing fractals. Of course, doing this in BASIC on a spectrum meant leaving it on overnight to run but then that just taught me about O(n) etc programs and optimisation. Secondly, you need him to be able to produce fun things easily. For BASIC on the spectrum it was pretty easy to draw on screen and make things move. With directx and C++ it's a whole lot harder and less fun. It's all very well outputting text results but I reckon graphics will be essential in keeping him interested. Python sounds good, or maybe something like DarkBASIC? Basically ou want him to learn the ethos of programming but unless he's driven and finds what he's doing fun it'll be an uphill struggle.

Re:python (2, Insightful)

Eudial (590661) | more than 6 years ago | (#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.

Re:python (1, Interesting)

Anonymous Coward | more than 6 years ago | (#24286343)

Yeah, this is the thing to do. Be sure to install Pygame, the Python wrapper for SDL.

It's amazing what you can do without ever leaving the Python language. Certainly this is a good way to learn, because you get all of the powerful high-level Python features and you don't have to detail with nasty low-level details like memory allocation.

Re:python (2, Interesting)

Olix (812847) | more than 6 years ago | (#24286495)

Don't teach him anything, its better if he sits down and learns it himself.

I know that learning in lectures in college is a very different ballgame to learning from instruction by one person, but I found that I only really improved my coding ability when I sat down and got myself a project I wanted to work towards. If the kid is interested in learning to code and wants to do interesting things with the computer, then he'll learn it himself - just give him some easy IDE and supply him with ideas for something interesting to write. He should be able to learn the rest himself with online tutorials and the like.

Some people bitch about it a lot, but Java is nice and simple to learn and there is something like 2000 published books on it.

No, it is still correct. (2, Insightful)

Corporate Troll (537873) | more than 6 years ago | (#24286161)

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.

More info (1)

Hognoxious (631665) | more than 6 years ago | (#24286175)

I don't know what your family situation is (indeed, I don't know if your his mother or father) but is the other parent any good at teaching?

I'd say let him try out a few high level languages where he can build simple programs that at least do something quickly - he could get bored with the details of C - and see which suits him. Help him out if and only if he gets stuck. If he reaches the limits of that language then maybe it's time to indtroduce C or assembler.

Write a game (4, Insightful)

gsslay (807818) | more than 6 years ago | (#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 (5, Interesting)

Anonymous Coward | more than 6 years ago | (#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.

Re:Write a game (0)

Anonymous Coward | more than 6 years ago | (#24286515)

or just let him have a look at


its a program-your-creature thingy... if he's grown up, tell him he's into multi-agent-simulation and ai
worked great for a couple of budies of mine

SDL (0)

Anonymous Coward | more than 6 years ago | (#24286181)

I recommend having a look at SDL. It's an easy-to-use multi-media library that is suitable for 2D gaming. Graphics and sounds are very encouraging and game programming can be technically challenging, too. If SDL is mastered and enjoyed, there is always OpenGL.

XNA is also something to consider.

Re:SDL (1)

LingNoi (1066278) | more than 6 years ago | (#24286257)

I disagree with SDL. pyglet [pyglet.org] would be a much better idea [google.co.uk] .

Game programming (1)

dvice_null (981029) | more than 6 years ago | (#24286193)

Teach about game programming. E.g. show how to draw simple graphics using libSDL and then perhaps give hints how the graphics could be moved etc.

I started programming myself, because I wanted to write games. I've been programming for 10 years and I still write games on my free time.

Re:Game programming (1)

FoboldFKY (785255) | more than 6 years ago | (#24286233)

I'd actually say: teach him how to do in-game mod programming. It allows him to make something that has graphics and sound without having to actually learn how to do graphics and sound just yet.

A good example is World of Warcraft. Lua is pretty easy to pick up, and he can make little graphical toys or try simple automation. Maybe start with the WowLua addon (which adds an interactive Lua interpreter to the game) and perhaps the TinyPad addon which lets him write small scripts and run them from within the game.

Failing that, there's always Logo. :P

Re:Game programming (0)

Anonymous Coward | more than 6 years ago | (#24286445)

I don't think this is a good idea. I speak from experience because I tried to teach someone Lua so they could write WoW addons. I failed for at least two reasons:

  • Lua is pretty awful as a beginning language. There aren't that many built in features. The type conversion is very confusing. This makes it hard to write simple demo programs and explain how they work.
  • Mod programming inevitably involves working with the API of the game; in the mind of the beginner, this will become confused with the features of the language, and this will ultimately be unhelpful. Especially as Blizzard will change the API at random intervals.

Other games would be even worse, since they will require C programming or something unspeakably bad like QuakeC. You *would* be better off teaching Logo.

The best option is to teach Python, then import pygame.

Games (0)

Anonymous Coward | more than 6 years ago | (#24286199)

...or "toys" like Lego Mindstorms, Robocode, etc. are perfect, if you are willing to invest some time setting him up.

Re:Games (2, Insightful)

aero2600-5 (797736) | more than 6 years ago | (#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.

Show him the Alice (1)

WetCat (558132) | more than 6 years ago | (#24286219)

http://www.alice.org/ [alice.org]
Nice 3d programming tool, and useful too.
he'll amaze friends!

Do what my father did (1)

TLZ9 (1194305) | more than 6 years ago | (#24286221)

Tell him that if you can program you can create games. (Don't mention how hard it is to pull off creating a 3D-game for one person. ) By the time I realized that my father didn't mention how hard it was to create really cool games I was allready interested in programming. ;) btw. You might want to suggest a language for him that more easily makes him able to get instant results. People are going to shoot me for this but something like Python, Java/C# or even *gasp* VB. (On the other hand, if he's enjoying C that's great as well.)

Start him off here... (4, Informative)

blahplusplus (757119) | more than 6 years ago | (#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.

Find an interesting project as a goal (0)

Anonymous Coward | more than 6 years ago | (#24286227)

I would suggest finding something that interests him and setting it as goal for some small programming project. When I started programming I was really interested in playing games (or more like creating them from scratch). I ended up coding simple games like PacMan. At the end I had learned some things in coding and had something to impress my friends. So, find an interesting project as a goal, learning will follow.

BASIC? (1)

Alarindris (1253418) | more than 6 years ago | (#24286229)

I taught myself BASIC on an Apple ][e when I was eight or so from books I checked out at the library.

It's fairly easy to read, i.e. TO, FOR, LET, GOTO etc, are self explanatory.

The most important thing to get through to him is program flow, learning other languages is cake once you understand how to efficiently break a task into parts.

I'm in college... (1)

redkazuo (977330) | more than 6 years ago | (#24286231)

I started programming when I was fourteen. My parents aren't programmers, so I had to find my own way through curiosity. I just tried creating a couple websites with frontpage and later dreamweaver.

A couple months later I found out about javascript and bought a book about it. Then it was Perl and the Cammel, then C.

I think you should try to show him skills that seem valuable to him, maybe because he could brag about it to his friends, or (if he admires you), he could get some recognition from his pop, or even try to make a little money creating a website.

Anyhow, the bottom line is that I think you should give him what he will find valuable and useful. I'm sure he'll find his way to unix soon enough, I did.

In my day... (1)

SimonGhent (57578) | more than 6 years ago | (#24286237)

In common with (I suspect) a lot of Slashdotters, I started out on computers in the Spectrum/CBM64/BBC days when you had to program, in BASIC, to get anything done and that's what got me going.

I stayed in computers, eventually doing a Computer Studied degree and worked for several years as a programmer for an IT consultancy company, using C++, Visual Basic, Java and C#. In the end (about five years ago) it seemed that all there was in "programming" was SQL. Now I'm not knocking database developers, but that didn't float my boat, so I moved into business analysis.

It seems that now, the majority of big programming is done off-shore, in India for the most part.

I'd suggest something web-oriented to get someone interested, but maybe teaching the basics of variables, looping, procedure calls and such-like in something like C++ or (dare I say it) Visual Basic would be a good place to start.

Re:In my day... (1)

robcfg (1005359) | more than 6 years ago | (#24286299)

I started with the Atari 800XL/ Amstrad CPC basic and I think visual basic it's way too complicated because it uses many things of windows that can obscure the learning process. That said, if we learned with older machines, why not give a try at some emulators and let him start doing things in pretty plain old basic? You can find most basic manuals for old computers quite easily and he won't be frustrated if a dll is not found or if he cannot guess why a weird event does not happen.

Hackety Hack (1)

BlackPignouf (1017012) | more than 6 years ago | (#24286241)

http://hacketyhack.net/ [hacketyhack.net] is the answer!

You can write blogs, mp3 downloader/reader and basic graphical interfaces in a few (Ruby) lines.
I wish I had it when I was a kid... GWBasic wasn't so glamour :-/

Do 3D (1)

zwei2stein (782480) | more than 6 years ago | (#24286247)

Basic "Hello 3D" with triangle rotating can be done in ~ 20 lines.

It takes a while to grasp, but it encourages and rewards experimentation.

First they will fiddle with numeric constants and see what it ends up, then they will add lines to add more objects, eventually learning cycles and arrays for some animation ...

Just don't bore them with background stuff unless they want to know it.

Keep it simple, for now (1)

Rigodi (1000552) | more than 6 years ago | (#24286265)

Based on personal memories

My father was into it, working on IBM 390 systems and I was eager to get my own computer, to see how it worked and to know how people could program it.
When we received the beast (ZX81) my father just spent a few hours showing me trivias about variables, for-loops and simple input / outputs. That was it.
Then it was just a question of personnal interest, that turned into passion, finaly. Later then the adult can help from time to time or give tips, perpectives, etc.
So my idea is that plain simple basic might be enough. May be just an old VB or a simple PHP sandbox. OOP, web technos can wait a bit. Just start with the 101 and look how your kid responds.
Hope this helps,

Solving problems (4, Insightful)

Yetihehe (971185) | more than 6 years ago | (#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.

Graphics Programming (4, Insightful)

Destrius (956) | more than 6 years ago | (#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.

Robot Battlin Gaems (0)

Anonymous Coward | more than 6 years ago | (#24286271)

There are tons of old emulated and new robot programming battle games... of course, you might have to play the game with the Teen yourself just so he can beat you at it...

Start with basics. (2, Interesting)

mimada (1252792) | more than 6 years ago | (#24286273)

Get him on a typing tutor first. It'll come in handy regardless of whether he sticks to programming. As he's learning to type, print out some interesting program listings (or get a book). Have him type in the programs (don't let him just cut and paste). Once he has the programs entered and debugged, have him modify or customize them.

Once he's done a few of these, he'll have experienced the rewards and tedium of programming and should be able to decide if this is the right path for him.

Javascript (2, Insightful)

dgun (1056422) | more than 6 years ago | (#24286279)

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

Be like Linus (0)

Anonymous Coward | more than 6 years ago | (#24286281)

Start em from scratch. Take away the OS! :-)

modify an existing game. DONKEY.BAS (0)

Anonymous Coward | more than 6 years ago | (#24286283)

Donkey.bas was an example BASIC game that came with old ibm personal computers.

one of the first things i remember doing is hax0ring DONKEY.BAS so that instead of missing the donkey with the car, the goal of the game was to hit the donkey with the car.

fun fact, years later i learned that bill gates actually programmed this game.

anyways, its a lot easier to hack up an existing game, do something funny, and use that as an intro to programming.

The interesting part of the problem. (1)

leuk_he (194174) | more than 6 years ago | (#24286285)

Maybe game maker [wikipedia.org] is nice way to get his interest.

It might not be the best introduction to programming, but it is fun and beats surfing the internet and dull programming in a true language.

Fun and money are the encouragement! (0)

Anonymous Coward | more than 6 years ago | (#24286287)

As a kid I played the ZX-Spectrum for a few years. At some point (probably a year after I got my hands onto this computer) I got interested in how people do the games, literally how they draw those nice pictures, pseudo 3d games, animation, etc etc. That made me learn Basic and Z80 assembler a bit later when I realized that I could do everything in Basic (at all or at a decent speed). I didn't do much game programming with the Spekky, but I did a lot of related programming on x86 PCs (3d graphics primarily) and actually had a few simple (almost playable) games prototypes written.
So, trying to understand what's behind a game and implementing simple games can be a good start with a lot of fun.

Then, when I was in my last grades at school my dad offered me to write a few simple applications (mostly text and numerical data processing) for him for some money. I was happy to do that as that made me learn some more cool stuff and I earned my first money. I continued doing that and learning everything I could and I'm now somewhat like what you describe yourself (maybe just not that long time and with less Unix experience).

So, do games and give work for which you'll pay. That'll teach him the stuff and you'll have fun. And at the same time it will let the kid see what he can do and how he can earn for real.

Would you turn down fun and money? :)

JAL on a PIC (0)

Anonymous Coward | more than 6 years ago | (#24286295)

If you have any electronics knowledge, learning to program a PIC to do fun stuff using JAL is a good way to go - I'm doing this with my 13 year old. Here's a good reference: http://www.voti.nl/swp/

Hello World says a lot about motivation. (1)

sleeponthemic (1253494) | more than 6 years ago | (#24286301)

Most programmers started out teaching themselves. Only mild support is necessary. Either he has the interest or he doesn't. Chances are if he's not especially moved by a hello world program he's probably not going be that motivated to stick with it.

NetHack! (4, Insightful)

ThePhilips (752041) | more than 6 years ago | (#24286303)

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! (2, Insightful)

ThePhilips (752041) | more than 6 years ago | (#24286309)

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.

PHP (1)

comra (917620) | more than 6 years ago | (#24286307)

Why not start with PHP where he can see the result instantly?

The best language... (4, Funny)

IBBoard (1128019) | more than 6 years ago | (#24286311)

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!

Information overload (1)

Yold (473518) | more than 6 years ago | (#24286317)

When I was 14-ish, I liked to futz-around rather than program seriously. If he is like me, and has a short attention span, buy him 3-4 books on programming, and point him to as many free source code websites as possible. Ebay has some cheap books I'm sure. Ideally, get him books on 2 different languages, and find ones that are moderately comprehensive.

The other 2 should be like coloring books for programmers, although I didn't understand nearly enough of the math at the time, DirectX in 24 hours was cool.

Javascript? Facebook apps? (3, Interesting)

6Yankee (597075) | more than 6 years ago | (#24286325)

No, really. That way he can share his games or whatever with his classmates, simply by sending them a link.

Of course it'll be a longish road to get to that point, but it might be a goal he can relate to - and I know I simply wouldn't learn anything unless I could see the point. Still don't at 34, come to think of it :)

Make it about programming and something else (5, Insightful)

shaka (13165) | more than 6 years ago | (#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).

Programming IS a game. (1)

SplinterOfChaos (1330441) | more than 6 years ago | (#24286337)

When my mom was learning, she thought it was fun making things and putting them on the screen, then changing them and seeing what happens. Just today, I tried to see what happens if I change all me velocity vectors to integers and it was fun to see everything stop moving because their velocity was always less than one to begin with.

Teach him how to play with code.

Also, whether or not you'd bore him is a level of his determination. I've been programming since 16 and I made worthless, unimpressive code until I was 18, but I kept on because I knew I'd some day make games. All that experience made it so that with one semester of C++ and an SDL tutorial, I could make a sweet and simple game.

On the other hand, many of the people who graduated for a degree in computer science claimed they never wanted to program again. Determination will decide whether he programs or not. He can have all the knowledge in the world, but not touch a computer again if he lacks determination.

Explicitly disallow it. (5, Insightful)

Anonymous Coward | more than 6 years ago | (#24286339)

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

Encourage? (1)

clarkkent09 (1104833) | more than 6 years ago | (#24286347)

IMHO the answer is don't. If he is really interested in programming, he will not need much encouragement, in fact the problem might be how to keep in away from the computer long enough to have social life. If he loses interest or finds it too hard, then you might unintentionally put him under pressure to keep going just to keep you happy or to prove he is smart enough, and that ain't no recipe for happiness. Be prepared to deal with a possibility that he might decide programming is not for him and that he really wants to be a male ballerina or something, because that's fine too if it would make him happier in the long run. As for the teaching methods, that's a tough one. I kind of lean towards getting them immersed in one thing, language for example, until they understand it in some depth and then using that as a base to learn other stuff. But then different things work for different kids, so there is no one correct approach

Ruby, Python, Qt (1)

slashflood (697891) | more than 6 years ago | (#24286349)

Ruby (maybe Python) is one of the last 'frustrating' and 'discouraging' languages out there. To make it even more interesting, give him Qt to play with. With Ruby/Qt or PyQt you can open up a window in just a couple of lines. Even 3D stuff can be done with that combination and that keeps him entertained for quite a while. Bonus: object oriented programming from the beginning.

Alice (0)

Anonymous Coward | more than 6 years ago | (#24286351)

Take a look on the Alice project. http://www.alice.org/
This is kind of movie-making Java environment.

How about Logo? (3, Insightful)

nithinsujir (592733) | more than 6 years ago | (#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.

My tactic (1)

Demena (966987) | more than 6 years ago | (#24286355)

was to use something I learnt while lecturing. People like to do things. Teach them 'sh' and the unix utilities. This allows them do do things. People learn by doing and love doing simple surprisingly powerful tricks.

Personally (5, Insightful)

ledow (319597) | more than 6 years ago | (#24286357)

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, well what about an infrared beam on the back door that sounds a chime when Dad walks out to the garden? £20 of hardware (much, much less if you have electronics skills) and another port on the joystick adaptor (I use K8055 kits from Vellemans which allow very simple analogue and digital inputs/outputs on a cheap USB device controlled by Linux or Windows in virtually any language). What about a turny-thing to keep the cat feed while you're away?

Too practical for you? What about something that can suck the Caller-ID data off a bog-standard modem connected to your phone line in the normal way and "announce" who's calling whenever the phone rings? Extend it to a home-voicemail or an automated remote system for checking status (Has dad walked through the front door yet, how many people rang the doorbell today?).

The electronics involved are absolutely minimal - you can literally do it all without having to buy any equipment or solder a single component/wire. If you do buy the right stuff, it's infinitely extendable and it becomes a giant, practical, lego/meccano/electronics kit. You end up with a result that can not only be shown off to friends and family but which is percieved as "hard to do" by people who don't do it (whereas knocking up a brilliantly-difficult 3D game will attract comments of "Yeah, but it looks crap compared to X").

Computers are not just about software. Software is written for the purpose of making computers general-purpose machines so that they can control a wide variety of hardware. Even the simplest of "non-standard" hardware additions to a computer provides a myriad of programming possibilities and will give understanding of problems that you *cannot* get in a university computing course. It will help your child immensely.

(I'm not a big hardware fanatic, my skills are primarily software-based, but I work in schools doing IT and I tell you now, nothing excites a kid like a decently-run ICT lesson using a new gadget, whether it be some videoconferencing gear that the teacher trials or a programmable turtle that the kids get to play with.)

The interest (0)

Anonymous Coward | more than 6 years ago | (#24286359)

When I started getting into programming, I was naturally interested and I think that's one of the important things, to be interested in technology from the beginning.

Now my teacher noticed my interest and showed me some cool stuff. (Well it was cool back then). Like how to use graphics in Pascal. Handle keyboard. Showed me how to make some tiny games and then I used to look at the code, try to understand and write something myself.

Or he gave me some books on the matter. Like assembly, it was hard to understand at that moment, but I had use for that knowledge later (in the University).

So the thing is: just show some cool thing/idea if he's interested he will explore it himself.

BASIC + graphics (1, Insightful)

Anonymous Coward | more than 6 years ago | (#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)

Low-level game programming (2, Informative)

4D6963 (933028) | more than 6 years ago | (#24286379)

Video games are fun, and making your own video games is fun too.

Start by making him learn text game programming, like the price is right. That's both on the very basic level of programming, and a quickly gratifying game to learn.

Then, maybe I suggest low level game program. And by low level I mean no SDL (well, maybe a wrapper), but writing your own pixels to a frame buffer is more gratifying. As in, teach him how to make a function that write a rectangle on a frame buffer depending on the rectangle's size and the coordinates of its center, then make him move the rectangle around by pressing keys.

Build on top of that by making he do a very basic game like pong. My first graphical video game was a pong and I coded it in two days, that's how easy it is.

From that point on, he will probably start to get ambitions. As in, he'll want to draw lines, load sprites, rotate them, use physics, learn about tcp/ip network, signal processing theory and techniques, etc, to achieve a precise purpose. All of these things will fuel his interest towards mathematics and physics, and give him a good reason to learn about and understand these things.

Finally, introduce him to more "real world" type of programming, by giving him some of the stuff you have to do at work, for uhh.. the sake of his education!

Inspire (0)

Anonymous Coward | more than 6 years ago | (#24286389)

The whole IT bit me because al of a suddon my dad came home with an Atari2600, without asking for it. I was so completely overwelmed by it, that I was interested in computers ever since ending up as a systems engineer, what I personally like.

Bottom line: In order to inspire young people by showing them the big picture first, and then let them find their way down to whatever interest them. If you start bottom up, little chance you'll catch the attention of a teen because it might be conceived as boring and not cool.

Processing (language) (1)

Oscaro (153645) | more than 6 years ago | (#24286391)

Processing is a java subset (but you can use full java if you wish) geared toward "visual computation". You can see some great examples here http://complexification.net/gallery/ [complexification.net] or on flickr (just search for "processing" tags). Project home page is here http://processing.org/ [processing.org]

I already used it to teach something to my nephew (12yo) and he finds it great, mainly because he can have some "cool" effects and stuff on the screen and can instantly see what his code does.

Not with C (1)

Lord Lode (1290856) | more than 6 years ago | (#24286393)

C is a great and powerful language, but maybe it's not so good for a teenager to begin with. Myself, I began with QBasic, which was on DOS on our computer. I only started learning C at later. QBasic was a great language to begin with because, it being a scripting language, had very helpful error messages if something went wrong and was very easy to debug. QBasic also had a quite nifty documentation. And there were two example games included which could be modified to start seeing the effect of changing code. I also loved it because you could do graphics with it - had I started with C back then, I'd have been bored by text input and output very soon. Of course today DOS and QBasic are less relavant today, and also not *nix as you asked. But maybe another language that is also a scripting language like QBasic, such as Python or Ruby, could be helpful?

Well......NetBeans? (0)

Anonymous Coward | more than 6 years ago | (#24286395)

I would start with netbeans ide for the kids....
you can c/c++, Ruby, Java and Fortran :P

it's made in java and uses the gcc and g++ compilers if installed.

it's a bit VS Studio in java wich you can run under *NUX or *NIX-like

good luck

First the dirty stuff.. (1)

Sidn (415686) | more than 6 years ago | (#24286397)

I would suggest you start off with some basic C to demonstrate variables, functions and then some more advanced but very important stuff such as pointers and structs. Structs are an easy concept for the introduction of classes, for which i would suggest some scripting language such as ruby (to ease experimenting on his own). This way he may appreciate the use of classes and the avoidance of pointers more than without knowing the dirty origins.

Concepts, not programming languages (0)

Anonymous Coward | more than 6 years ago | (#24286403)

Show him the concepts of how information is worked on with. Show him your work and what you do.
Show him the simple steps what happens when you listen to an MP3 (filesystem, reads, put data to the soundcard) etc.

He first needs to establish a notion of how information flows in a computer and that a computer essentially cannot do anything besides addition (and stuff).

You don't. (1)

TheSeer2 (949925) | more than 6 years ago | (#24286405)

You give them a computer, if they're the kind that's built for programming they'll do it themselves.

My experience (5, Interesting)

mtxf (948276) | more than 6 years ago | (#24286407)

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 ;)

FFS! (0)

Anonymous Coward | more than 6 years ago | (#24286415)

Programming? We need plumbers! Good plumbers, and builders, craftsmen... not another mediocre programmer.

write a game with him. (1)

buttle2000 (1041826) | more than 6 years ago | (#24286419)

I started writing games from the radioshack trs-80.
With python or something else you could easily do a text adventure game.
a bi-dimensional array of objects. each one a room.

good luck.

Don't do like daddy (0)

Anonymous Coward | more than 6 years ago | (#24286421)

Get him to program stuff like mini-robot, with PIC-BASIC or something similar. Programming electronics *is* funny. This way, with some luck, he wont end up as a pure software geek, useless nowadays in your country !

Link computer programming to his schooling (1)

LM741N (258038) | more than 6 years ago | (#24286427)

First, like the other poster said, start him out with an easy to learn language like Python. Then as he gets more experienced, he can use the innumerable Python add-on packages to do all sorts of things. Remember, the O'Reilly Python quick reference book is the thinnest of all of them. I use Python and various incarnations of Numeric Python as the language doesn't get in the way of prototyping algorithms. Later they can be ported into C or FORTRAN.

You don't say what age he is but do ask for the opinions of those in high school so I am assuming he has already learned quite a bit about math (although this is 2008, not 1975, so who knows what crap they are teaching kids?) I was always bored with math especially in high school. Thus he might be at a stage where he could find out where applied mathematics is really done- on a computer.

The real world doesn't boil down to simple closed loop equations, as many simply cannot be solved in practice on a piece of paper or an exam. They require iteration to some tolerable error function, so that a very close approximation of the answer can be found. That requires the very high speed of the computer in order to do the iterationa in some reasonable amount of time.

Moreover, topics like integral calculus are very easy to explain on a computer, since the computer performs it just like is done in the first week of classes, by breaking the area under a curve into very small parts, and adding up all of the resultant parts of the function. Thats a lot more intuitive than some obscure looking equation.

I could go on and on, but I think you get the general idea where math is concerned. In science, where many calculations might be needed to solve a problem, he could just write a simple program to do the same in a microsecond. A great example of how a computer can speed up productivity and research. It would probably be great for homework, although he would still need to know the curriculum of the class in order to pass an exam- unless they now use computers in math exams, which I doubt.

I really wish I had a computer in high school, as I was already doing quite a bit of electronics. But alas it took a few more years for the PC to be invented. In my days, just having a hand-held calculator was quite a luxury.

Do yourself a favor... (5, Insightful)

Chineseyes (691744) | more than 6 years ago | (#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).

Give him a C64 (1)

Lord of Kaos (1318447) | more than 6 years ago | (#24286433)

Bigges geek producing machine ever. :)

Draw on the experience of the community (2, Funny)

jeevesbond (1066726) | more than 6 years ago | (#24286441)

Draw upon the extensive knowledge of the GNU/Linux community, for example:

  • whenever he asks a question, reply with either: 'OMG RTFM!!!11!One' or 'man *question*'. The shortest and most arrogant answer is always most helpful.
  • if there's a piece of hardware not supported, the best way of helping a newbie is by shouting, as loudly as possible, 'IT IS THE MANUFACTURERS FAULT!' Calmly explaining the situation with hardware support in GNU/Linux is not a good idea. It only leads to further questions (to which the answer is 'OMG it's Free software, code the driver yourself you n00b!');
  • if he finds any shortcomings in the software, ensure you encourage him by assuming the problem is his fault. Make certain to chortle condescendingly whenever he points anything out to you. If it is at all possible to blame the shortcoming on him, ensure that as you wander off -- chortling as before -- say, just audibly, 'luser error';
  • newbies feel most secure when their mentors display their superiority, always make sure your boy is aware of your vast knowledge and epic intellect;
  • loudly proclaiming that, 'next year will be the year of the Linux desktop' makes GNU/Linux newbies feel secure about the platform's future;

If he actually does find a bug, here are some of the basics you should tell him about bug reporting:

  • keep it vague - developers don't want your life story, don't bother with debug traces and all that guff;
  • always gush - the ideal bug report is at least half gushing about how he loves the software;
  • demand developers contact him personally - this is very important, developers prefer communicating privately, private e-mail is best;
  • always raise new reports - it's never worth the bother of checking whether your bug has already been reported;
  • bug reports aren't just for bugs! - feel free to use bug reports for idle chat about the issue, or related things, even for just storing your shopping lists, tricking people into viewing goatse, or even rickrolling the devs;
  • most bug reports are the highest priority - if you're raising a bug report, it's of the highest priority to you, right? So generally, enter bugs with the highest priority possible.

Now this post may seem like a troll, but if you do exactly the opposite of what I advise, he should do well.

Find something your kid likes... (1)

dave420 (699308) | more than 6 years ago | (#24286449)

... then show him something *you* made that builds on his interest, making it even cooler. Robots, tanks, helicopters, police cars, whatever it takes. That will pique his interest like nothing. Encouragement, explanation, even bribery (reward coding something specific with money - worked for me). Both of my parents were developers back in the early days of mainframes, and that's how they got me hooked. I've been coding since about 6 or 7. I say "coding" - back then it wasn't much, but it sure was excellent fun.

Children oriented language (0)

Anonymous Coward | more than 6 years ago | (#24286451)

There's a GUI programming environment called Greenfoot, well suited to 2D games, specially written to get children and teenagers coding. It's similar to Java/C, and is free. (I think it's Windows only, though.)

Pascal was the hook for me (1)

mariushm (1022195) | more than 6 years ago | (#24286459)

My father worked at a chemistry research lab and they had a small computer room with 4 486 computer (it was 10 years ago).

I went there with my father wanting to play Mario but one of the people there started Pascal and showed me how to draw lines and circles in it.

So I started drawing houses and trees and I got hooked.

Hardware (1)

spankymm (1327643) | more than 6 years ago | (#24286463)

Buy him some uber-cool hardware which doesn't have *nix drivers, and delete his only copy of windows.

how i started (1)

theheadlessrabbit (1022587) | more than 6 years ago | (#24286473)

when i was young (12ish), i had a magazine subscription that had a section in the back of every issue called "basic training" where it gave you the code for a simple game that you could program yourself.

i sat myself in front of my IBM PS/2 (which i still have, and it still works) and typed in the BASIC code, only to discover that QBASIC does stuff differently than whatever version of BASIC the magazine used. but i had spend hours coding, i refused to let that go to waste, so i read the error messages and help files, and eventually got some of them to work. then i modified them.

then i started making my own games, (including that RPG that every single programmer in the world is working on yet never finishes.)

i was playing a lot of command and conquer around this time, and i discovered the awesome power of the "rules.ini" file, so i started making games with separate text files to control the variables, so i could tweak them game more easily.

then i finished elementary school, and got stuck in high school with the crappy workload, making coding impossible.

high school programming class was a joke, but then when i went to art school, i got really excited about micro controllers, and the BASIC stap let me use QBASIC again, and i was happy.
then i discoved the picaxe system, which is an even easier form of basic, and way less soldering.

i would have to say, working with BASIC powered micro controllers is the way to go. BASIC is so easy, even I can do it, and when you finish, you have something that you have built yourself, and it actually does something! its a damn good feeling.

Simple (1)

Snaller (147050) | more than 6 years ago | (#24286475)

Tell him if he does it right he'll make tons of money and then all the women will want him.

Make it fun and keep it simple (1)

jonnyj (1011131) | more than 6 years ago | (#24286481)

My lad started coding when he was about 10, but it took a few false starts. In my experience, compiled languages like C aren't a great place to begin, as the need for compilation really gets in the way of the learning experience. I also had a failure with PHP - I thought that he'd enjoy web hacking as he was comfortable with HTML, but I found that cookies and sessions - without which you can't do much in a web environment - were a huge conceptual problem for a young mind.

You need to start with something that's simple, rewarding, well documented and with good community support. A language that permits procedural code and dynamic typing is also much easier to teach. I suggest Python for the language as it has a great beginner's IDE on Linux (DrPython) and, importantly, it produces comprehensible error messages (Ruby on Rails: I'm looking at you). It also produces clean, legible code.

You need to move beyond text-based programs pretty quickly: no-one wants to show off a terminal session to their mates. GUI interfaces aren't very teenage, so I suggest you check out PyGame for graphics and sounds - simple to learn with quick rewards.

Finally, enter the next PyWeek competition with your lad - he'll never win, but it'll help him to see how a more complex project fits together and give him a gret sense of achievement.

Do it the university way... (1)

Splab (574204) | more than 6 years ago | (#24286483)

Start with SML (moscowML is a nice one), teach him what recursive functions are and how to solve problems. Teach him about datatypes and how to define your own, show him how to make trees and how to traverse them (go look at the curriculum, run the same thing with him - heck as a C programmer chances are you will learn something) If someone is used to programming ML can be quite hard to understand and very frustrating, however as a language for someone new to programming its easy to get started with and it wont teach you bad habits like PHP.

Next is usually Java, its a nice object oriented programming language for newcomers to learn about objects and its a safer way to program compared to C/C++. If the interests in programming still persists at this point show him C/C++ and the work you are doing.

Also remember, while doing all this you should gradually introduce stuff like algorithms and advanced math, they go hand in hand with programming.

Show Your Enthusiasm (3, Insightful)

Dean Edmonds (189342) | more than 6 years ago | (#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.

Simplest Way (1)

sheriff_p (138609) | more than 6 years ago | (#24286491)

Help him to find a project he's interested in, in a language/environment where he can get damn-near instant results, and then let him run with it, offering guidance only if he asks for it.

Hell, I got in to programming when I saw my brother playing on a BBC Micro, and asked him to teach me. I was 8 at the time. He helped me draw a picture of a door (using grid paper to sketch it out, and then copious LINE() or whatever statements). It was the coolest thing I'd ever seen. Next I drew a space-ship (and a pretty piss-poor one too ;-)

No-one needed to teach me after that. I read all the programming books I could find and old Micro World or whatever it was called magazines... And, I still love programming :-D

Get him started with Javascript. It's an awesome little language that scales up to all sorts of useful programming concepts, but best of all, you can get visual results reeeally quickly. There are lots of tutorials on the web, even if most are shitty. If he's still on it after a week, buy him the ORA book.


Porn... (0)

Anonymous Coward | more than 6 years ago | (#24286497)

1. Take some good porn.
2. Encrypt it with a simple algorithm, ROT13, something like that.
3. Give him the algorithm and the encrypted porn.


Give him his own machine (1)

Eternal Annoyance (815010) | more than 6 years ago | (#24286499)

Put slackware, gentoo or another advanced distro on it, but don't install a gui (the next step is games, which burn away a kid's time).

Let him figure things out by himself and make sure he's got easy access to the basic information, the rest he should be able to figure out himself.

Make sure he's got complete access to all information about his machine (so he can maintain it by himself).

Just don't (0)

Anonymous Coward | more than 6 years ago | (#24286505)

a teenager is not supposed to do any programming. Let him hang out with friends otherwise what you get is a geek.
He can discover the joy of programming when he is older.

C! Not C! Sweet Zombie Jebus! (1)

whistlingtony (691548) | more than 6 years ago | (#24286507)

Hello World is C? Sweet Zombie Jebus....

We all started on something easy like Basic, or tapping something into a TI calculator, or what have you. It was the almost instant gratification that got us hooked.

A little typing, tapping, It Ran! oh wait, that's not quite right....
A little typing, tapping, It Ran! oh wait, that's not quite right.... and a few years later you look up to discover you're a Nerd.

Now granted that's horrible coding practice, but it's what we started with. We all programmed little games. Who among us didn't try their hands at tank wars or Pac Man, and of course most of us tried to write a character generator for our favorite RPG. The point is we didn't start programming, we had other interests that programming could help us with in a cool manner.

Don't start with anything low level. Don't even think it. C? Seriously? Please do introduce good practices. Write out a flow chart, do your pseudocode!

Find a little project for him. Start with something small. Show him how to tweak things. You'd be amazed at how cool it is to change a little bit of text on some program. Do something related to something in the real world that he enjoys.

And don't be peeved if he decides it's a giant PITA, 'cause we all know it IS. :D


Give him Visual Studio (1)

hinchles (976598) | more than 6 years ago | (#24286521)

Give him a copy of VS with C# as primary language and set him some simple challenges to do. Perhaps start with something like "make a basic calculator" all of this can be done in the VS GUI without him having to go in depth for all the framework and structs of the project all he'd have to do is create the onclick events to take the 2 inputs and the action fairly simple and yet should be challenging enough to get him interested. If he can manage that kind of task in something simple like VS then you'll find it'll really get him interested and he'll then start poking around at the more complex stuff. Alternatively give him EditPlus and tell him to make you a simple signup and login website in something like PHP and MySQL again simple enough but with enough challenge he'll have to look up some stuff and read some docs etc.
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?