Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My brother is 12, and he's asked me several times to teach him how to program. I'm confident that I'm not a terrible programmer, but I don't see myself as an effective teacher. I taught myself most of what I know, using books and the web.
I've loaned him the "Head First iPhone Development" book, which was quite obviously way above him, since he—like I was at that age—loves to read fiction, but hates technical books, and has no prior experience.

I also asked him for an app idea, and he came up with something that involved 3D modeling and such. It's great that he's aspiring high, but I doubt he has the patience to learn enough to gain patience to learn the rest.

He's definitely bright, and I was able to explain the concept of variables to him. I'm taking a C++ course in college and I can probably pass that on to him. Is that a dumb idea?

What do you suggest? Should I continue to encourage him? If so, what materials should I suggest?

share|improve this question

closed as off-topic by MichaelT, gnat, Robert Harvey, Bart van Ingen Schenau, Kilian Foth Nov 6 '13 at 8:23

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking career or education advice are off topic on Programmers. They are only meaningful to the asker and do not generate lasting value for the broader programming community. Furthermore, in most cases, any answer is going to be a subjective opinion that may not take into account all the nuances of a (your) particular circumstance." – MichaelT, gnat, Robert Harvey, Bart van Ingen Schenau, Kilian Foth
If this question can be reworded to fit the rules in the help center, please edit the question.

Instead of teaching him, let him play with the programming environment as a toy. I as a child was fascinated with computer simply because it does whatever I instruct it to do. What you need to do is to set a programming environment and to show him an example and references where he needs to look when he need some help. – Tae-Sung Shin Sep 2 '11 at 18:52
Fiction /= technics. You say he isn't interested in technical books, has no prior experience (okey, that one is expected) ... has he any idea what it is you do (programming)? What it is for real - not some conception he's come up with? Maybe you should start with that. Apart from that, I'd have him start with a Python/Ruby/MATLAB book ... anything that will get&keep(!) him interested for more than a goldfish's memory of time :) – Rook Sep 2 '11 at 19:03
Big objectives are reached through small steps. If he does things in leaps and strides he might run out of steam and get discouraged. – James Poulson Sep 2 '11 at 22:33
Off-topic?! Really!? Should we create another stack site for this? – cvsguimaraes Feb 22 '14 at 1:10

13 Answers 13

up vote 52 down vote accepted

I think that C++ may overwhelm your brother. Try with something simpler.

I'd suggest this book

enter image description here

From the preface

I have more thanks for your interest and more apologies for this book's deficiencies than I can enumerate. My motivation for writing this book comes from a gap I saw in today's literature for kids interested in learning to program. I started programming when I was 9 years old in the BASIC language with a book similar to this one. During the course of writing this, I've realized how a modern language like Python has made programming far easier and versatile. Python has a gentle learning curve while still being a serious language that is used by programmers professionally.

share|improve this answer
I'll second that. Not only is Python simple, but it lets him see results quickly, without the need to compile. It also enforces readability, which is a good thing to learn early on. – Robert S. Sep 2 '11 at 18:40
He just typed in the first example. Yay! (Now if I could only make him see the value in actually reading the rest of the PDF, beside for code...) ^_^ – Moshe Sep 4 '11 at 3:50
@Moshe Teachers all have that trouble and the only way he'd really learn that he needs to read it is by reading it. I remember my teachers giving me small (annoying) comprehension questions that got me to read the text. Unfortunately for you that'd probably be a bit extreme, so i would suggest reading it and asking his questions like: "why does thins .. " or "What would you use for.." etc. – James Khoury Sep 5 '11 at 2:13
Agreed. Python is a much better beginner language than C++, IMO, due to fewer intricacies to learn that are environment or compiler-specific. Get down to just the fun part, not learning which compiler or IDE you ned. – Jordan Sep 9 '11 at 3:34
+1 Sweet I came here to recommend this book! – ioSamurai Sep 26 '13 at 15:36

I recently found

enter image description here

And was impressed by the barrier to entry aspect of learning to program in an interactive way; most importantly in the browser. Granted they start off with JavaScript, but what you learn there is kind of similar anywhere.

Another great resource online is MIT Open CourseWare stuff which is $0; and Peteris Krumins entire website:

Finally, programming language syntaxes might give his brain some pain; but knowledge of what he'd like the computer/server to do is best learned by rigorous focus on truisms like math, physics and other sciences. MIT OCW might assist in learning some of that stuff for free.

Given that he's 12 - his understanding of the world is most definitely more innocent and simple. Sometimes that is good for overall design of code/visual assets/behaviors. I'd recommend you encourage him to learn at his own pace, but learn things that matter to him, not necessarily things that have associated coolness oozing out of them.

Also, in your locale, suggest if he'd like to go to meet ups where other programmers meet and talk shop. This will provide him an outlet for asking questions that he might not wish to ask of you being an elder brother and all.

Good luck!

share|improve this answer
1 was recently mentioned in a LifeHacker article. – Mateen Ulhaq Sep 3 '11 at 1:08

Take a look at Scratch from MIT. Looks very cartoonish, but has surprising depth but should be perfect for the age you mention.

Scratch is an educational programming language and multimedia authoring tool that can be used by pupils, teachers, and parents for a range of educational and entertainment constructivist projects from math and science projects, including simulations and visualizations of experiments, recording lectures with animated presentations, to social sciences animated stories, and interactive art and music. Simple games can be made with it, as well. Playing with the existing projects available on the Scratch website, or modifying and testing any modification without saving it requires no online registration.

Scratch allows users to use event driven programming with multiple active objects called "sprites". Sprites can be drawn — either as vector or bitmap graphics — from scratch in a simple editor that is part of the Scratch, or can be imported from external sources, including webcam...

share|improve this answer
Scratch is a fantastic first computer programming language. It's everything Logo tried to be but fell short of. When your brother has exhausted Scratch, move him up to PyGame. He can go anywhere from there. – GlenPeterson Sep 26 '13 at 14:23

The main problem I see with todays programmers is they learn to write code before they learn how to solve problems. Which ever book you give him or whatever language or resources you use, make sure you take the time to teach him to solve algorithmic exercises which, although he will never use in real life, will teach him how to deal with challenges, when the framework won't fix it for you.

EDIT: I am sorry if you disagree, but what I love about programming, the reason why I became a Software Engineer was to solve problems and my favorite subject EVER was during my first semester when I learned how to solve problems with algorithms (written on paper). The kid can be young, buy if he is old enough to understand programming code, he is old enough to understand problem solving. And even while developing games there is lots of problem solving. It'll make him a better programmer in the future. (I am as demanding of my little brother as well, who by the way, plays guitar and from very early I insisted in him studying music, not only cords.)

share|improve this answer
Commenters: comments are meant for seeking clarification, not for extended discussion. If you like this solution, up-vote it. If you don't like this solution, down-vote it and consider leaving your own answer. If you'd like to discuss this question with others, please use chat. See the FAQ for more information. – user8 Sep 3 '11 at 2:44
@Mark Hey mark, I understand what you say about the comments, however, is there a way for me to see them, like in some history log or something, since I was not able to read the last ones before you deleted them? Thanks. – AJC Sep 3 '11 at 16:09
Solving problems is most super-funnest thing ever to people who love to program. My first exposure to programming was Telly the Turtle on (I think) a TRS-80 in second grade, ca. 1985. It was a game, but you actually wrote programs to solve problems. And it was a blast. The funny thing is, at some math & science camp when I was twelve, Logo was reintroduced to me to solve much more difficult was still a blast. I hope this guy's little brother catches the programming bug, but would hate for him to get hung up on language crap. – Keith Layne Sep 9 '11 at 4:10

I would recommend Processing. It's a programming language based on Java (actually it's a slightly modified Java), that are heavily geared towards doing interactive animations, including 3D graphics. I think it's one of the easiest environment to start with for learning graphics since their primary target is learner and graphic artist (not programmers); once you get him hooked, you can then start with a more general purpose language (e.g. Python+Pygame).

share|improve this answer

What about Microsoft Small Basic? It's a programming language and IDE made especially for kids, with a built-in tutorial.

With a friendly development environment that is very easy to master, it eases both kids and adults into the world of programming. Small Basic combines a friendly environment with a very simple language and a rich and engaging set of libraries to make your programs and games pop. [...] Learn the programming concepts starting with the fundamentals and move your way up. Small Basic is based on .NET and what you learn here could be easily applied to other .NET programming languages like Visual Basic. And when you do graduate to Visual Basic, you can bring your existing programs with you using a built-in conversion utility.

Also, your brother is just at the right age:

Small Basic is intended for beginners that want to learn programming. In our internal trials we've had success with kids between the ages of 10 and 16. However, it's not limited to just kids; even adults that had an inclination to programming have found Small Basic very helpful in taking that first step.

share|improve this answer

You remind me of when I had the same age... unfortunately, no Web at that time... :)

Of course you should encourage him!

If your brother loves videogames like I did (and do), back in the days I started to actually enjoy programming thanks to BlitzBasic. There are other alternatives also, like DarkBasic.

Simple basic-like syntax, but with support to more C-like powerful features, and most importantly it lets you create videogames with relatively little effort. You can program anything with it though. In a couple of hours you will be ready to code and teach him.

Ok I must admit I still use it, it's a lot of fun! :P

Anyway, don't just give him a book. I think it's too much for a 12 yo boy. You should teach him little by little by yourself.

share|improve this answer

Does he know algebra? That'll help... Even just the basic concept of a + b = c, a = 1, b = 2, find c is pretty good.

I learned on C++ - when I was 10. You need a competent teacher, but C++ is VERY powerful, so you can go far and never need to learn a new (or significantly different) language. After all, C++ is only one step a way (in various directions) from C, C# (ugh), D, Java, and Objective C. That'll go a LONG ways. Plus, there are plenty of libraries like QT and Boost to do fun stuff (from a programmers POV) with.

Whatever you do, make sure it's a REAL language - not some language where everything is drag-and-drop. Sure, it's fun for a while, but its too limited to do anything more than tic-tac-toe.

Some newer languages (mostly scripting languages like Perl and Python) can give you faster results, but I've always like "proper" compiled languages - they seem to be more powerful in general, and while I like good design (Apple fanboy here), I also like power - hence, I don't use Ubuntu, since I can't actually login as root. But they are very useful for more temporary/glue programs (i.e. interfacing between a user and a backend), or programs which require good cross-platform support. Certainly if he wants to make and iPhone app, scripting languages will NOT work well.

I do wish him the best of luck. And please take my advice with a grain of salt, and I'm only 16 now...

share|improve this answer
Heh, no worries re age. We're starting with Python, as per the selected answer. Thanks for your input! – Moshe Sep 4 '11 at 3:49

Normally, teenager like your brother is still the time to spend time with playing. If I may suggest, the best way is trying to explain in mathematical tricks, e.g. How do you describe that 12 X 4 = 48? How do you solve in triangle, just say under the right angle is 4 cm and the other side of right angle is 3 cm, hence, the answer of diagonal line is 5 cm? Teach him step by step and systematics.

share|improve this answer
12 x 2 = 48? That's some newfangled math there. – Winston Ewert Sep 3 '11 at 21:58
I am sorry. I was mistaken. Supposedly, 12 X 4 = 48. Thank you – Eric Jansen Sep 4 '11 at 3:47
@Winston In other words, 3 x 7 = 42. This is incorrect because 6 x 9 = 42. – Mateen Ulhaq Sep 8 '11 at 2:19

Snakes and Ladders

It involves:

  • Data entry: Player names.
  • For loops: Each player takes turns.
  • While loops: The game goes until someone wins.
  • If statements: Landing on a ladder or snake.
  • Events: Press a button to roll the dice.
  • Random numbers: Rolling the dice.
  • Arrays: The position of each player.

And there's a wealth of ways to improve upon this. Snakes and Ladders may not be the most exciting game, but the requirements are well known and he can get straight into designing it and having fun.

share|improve this answer

1) determine what his motivation really is. He may just want to spend time with you and not have sufficient motivation to invest in learning to program.

2) take a look at Chris Pine's "Learn To Program" book/available online. If he can't get through a bit of that, go play outside.

3) avoid any language without a REPL. Ruby and Python work well and are easy entry points with a lot of power for more advanced projects. C/C++/Java require more effort than most 12 year olds can muster.

4) If he's interested in hardware, Lego is good but an Arduino project might be more exciting. Also Check the local schools for robotics programs or camps.

5) Teach him how to layout projects, storyboard ideas, and develop concepts to create an application or game. The creative aspects can be a lot more fun at that age. He could be brilliant at it and you can farm out the technical work to create the next killer app. Dave Perry's Game Design book as a ton of info for brainstorming.

share|improve this answer

One thing I remember about learning to program as a kid was that I was really excited about doing it. I would be up clacking away on my keyboard at 3AM because I woke up with the solution to a bug in the games I was making on QBASIC.

So if you can make it exciting, and he is actually into it, then that is really key for a 12 year old. If not, it probably won't happen. I tried to get my little brother into it but he just doesn't seem to care enough. It's hard for me to imagine being 12 and not drooling over this stuff... but that's me.

As for actual materials, I was going to recommend that Python game book that was already posted, it's quite good! Paired with a real desire to make something nothing will stop him.

share|improve this answer

I would start your brother off with a good object oriented programming language like Java. It's well documented and a lot of free tutorials. C++ is too complex for the first time programmer in my opinion.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.