Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am home schooling a 15-year-old and would like to teach him programming. Our home computers are all running Ubuntu. What are some good options? So far I am leaning toward Scratch, but I also recently found out there is a free Basic project in the Ubuntu repo geared toward teaching, although I haven't checked it out yet. I also have thought of jumping straight to Mobile development, since he has an Android phone and that would be a pretty impressive conversation starter if he could learn to develop his own apps. I'm very open minded on this... sky's the limit!

share|improve this question

closed as not constructive by MichaelT, Jalayn, gnat, GlenH7, Dynamic May 11 '13 at 0:24

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
No one seems to be mentioning anything about Scratch... –  JoelFan Oct 5 '10 at 17:45
10  
@Spash: Scratch? It's unheard of. I don't think it's appropriate for a 15-year old and learning real programming. "toy language" is a word that comes to mind, but really, it's a "kids language". Wikipedia says its designed for 6-16 year olds. Give him an adult language, he should be able to do it. I certainly did.... –  Paul Nathan Oct 5 '10 at 17:58
2  
@Paul, what about starting with a "unit" on Scratch then moving on to "adult" languages? I'm thinking Scratch would get him motivated and also give him the general idea of what programming is (i.e. steps, decisions, loops). –  JoelFan Oct 6 '10 at 12:47
1  
@Spash: If I was creating a high-school year or two of programming, I would invest in some sort of embedded system with IO controllers and base the curriculum around building something that directly interfaces with the physical world, then unit one would be "make the LED blink". Unit two would be "make the motor turn". I just don't see Scratch as interesting intellectually or in my gut. –  Paul Nathan Oct 6 '10 at 15:43
1  
What?! No Microsoft?! No Visual Studio?! Good man. ;) +1 –  Neil Nov 18 '10 at 14:08

12 Answers 12

Python is a pretty good choice, and can run on linux. you might want to look into Pygame, a framework for building your own games. There's also a lot of games whose source is available, so you could look at it and manipulate to see how it affects it.

Possible Books to use (based on comments):

share|improve this answer
1  
Plus there are books like Manning's Hello Python geared to pretty much exactly this case... –  Murph Oct 5 '10 at 14:11
2  
There's also 'Head First Programming' book that teaches programming in general with the help of Python. That might be a good place to start. –  Anna Lear Oct 5 '10 at 14:36
    
Python (or Ruby) get my vote too. Anna makes a good point - the Head First books teach principles without getting entrenched in language specifics, so that combined with a nice expressive, readable language like Python may be a great choice. –  dannywartnaby Oct 5 '10 at 15:51
    
Pygame is a good choice. Game programming is hands on and engaging, it lets you see visual results very quickly. –  Matt Olenik Oct 11 '10 at 20:05
    
Dive into Python is NOT for a beginning programmer learning his first language. "Learn Python the Hard Way" or manning.com/sande may be better choices. –  Eric Wilson Nov 7 '11 at 14:54

Are you teaching him as a general learning experience or is this something he wants to do as a career?

If this is a learning experience, something like R is probably the most useful thing. It will teach him problem-solving skills as well as the ability to load and analyze data files, which is also very useful.

If this is a career thing, C is the appropriate starting point. Believe me, I taught myself QBASIC when I was 13 and C++ when I was 15. He's not too young at all. C will provide appropriate rigour and the least amount of magic. Python or other sloppy dynamic languages are quite inappropriate. They have way too much magic and hidden weirdnesses.

I don't hold that making something "fun" by dumbing it down makes the learning experience better. It instead damages the student for bigger things and introduces bad habits. I had to unlearn aspects of QBASIC and then relearn how a computer really works. That's a waste of time and a frustration.


editorializing based on my experience as a self-taught programmer who was homeschooled then went to college for a BSCS.

Fun is in the mind of the person. There is no reason to select fun as a driving component for non-elective education. The goal is to select that which will raise the student to a higher plane of education. Quick fulfillment through "easy programming" will not induce the satisfaction that comes from deep understanding or deep struggles to learn.

Most good hackers learn to program in their teens through self-determination of their course. As the parent/instructor, you have a unique opportunity to either be the driving hand or the guiding hand. I would suggest you start with K&R's classic C book and explain that with that knowledge he can then move to Android development, kernel hacking, GUI work, etc. Fundamentals are absolutely essential to have; once you have them, you can go anywhere. Let him choose where to go after he understands the basics of C.

There is no royal road to geometry or programming . It will be tedious, frustrating, and a lot of work, regardless of your pick of platform or language. If the end of the road - the working program - is fulfilling to him, then he will pursue it further and the fun will be extracted from the the activity and the results.

edit: Mason suggest Pascal/Delphi. Pascal is also great. It's not as popular as C, and is slightly 'outdated', but it still works at the memory level of the real computer. I liked Delphi a lot but the doc/tool support just wasn't available for at the time (or I couldn't find it).

share|improve this answer
    
Good answer, if it's going to be "Linux" programming it oughta be in C. Following a good curricula will make it seem less cryptic than a programmer falling into some code to debug - anyway, this is what I hope to do when my kids have a long enough attention span. –  Peter Turner Oct 5 '10 at 17:11
    
QBASIC is an excellent choice for a first language, (Bias: mine too!) It operates (somewhat) close to the hardware, but is sufficiently English-like to be easy to follow. Also, the graphics capabilities are good for beginning game designers. –  Michael K Nov 12 '10 at 19:07

I saw Scratch demoed the other day by one of its designers, and I am pretty certain that even for a 15-year old it is great to get the basics straight. It even runs the blocks in parallel so that can be introduced right away.

When he is comfortable with that - you can do some quite nice things, and show them off to your friends - you can start with all the boring Hello World things, but frankly I think that the instant gratification in Scratch holds a lot longer than most people think.

share|improve this answer

Any scripting language (Python, Ruby, Perl) will IMO teach bad practices. Start off with something with more structure and less help. C++ or Java.

Higher level scripting languages come with conveniences that are not found at other levels of programming. Callback functions, .each loops, dynamic typing, built-in operators, libraries. These are all detrimental to your overall mindset. Limit the comforts available until he can create those comforts himself.

Start off dumb. Working in something like C++ or Java that forces you to choose a type for your variable and offers excellent language structure enhances your ability to think like a programmer. Then moving on to "smarter" languages will be easier.


If you were training a cook would you buy pre-seasoned food? Or would you give him the tools to create it?

share|improve this answer
2  
On the other hand, starting with something easy and productive will make him more interested, and you can always teach somebody to do things right in any modern language. –  David Thornley Oct 5 '10 at 14:48
8  
Yes. Teach him C++ to show him how power-sappingly mundane it is, or Java to break him. Failing that, opt for a scripting language to teach principles - he's 15 and learning should be fun, rapid and accessible. –  dannywartnaby Oct 5 '10 at 15:49
2  
@Paul Indeed, and I wouldn't claim there is one, but ultimately the vast majority of programming concepts are language neutral, so why not reach for a fun, high-level and human-readable 'scripting' language for the purposes of learning? If i'd have learnt with C++ I wouldn't be doing this job today, which is, ironically, C, C++ and Objective-C. –  dannywartnaby Oct 5 '10 at 16:30
1  
@Josh K: Who wants to go low level? How about everybody I know who started with BASIC or something like that and learned assembler? As far as cooking goes, we started our son out easy, with packages (his first dinner for us was a particularly easy variant of macaroni and cheese). Giving him a pile of raw ingredients would have both discouraged him and gotten us an inedible mess for dinner. –  David Thornley Oct 5 '10 at 21:25
1  
@Josh K: I'm not grooming my son for anything, really, but the first thing I wanted him to do was to successfully prepare a meal. We're not talking here about taking a 15-year-old who's determined to learn to program, but rather a 15-year-old who should be exposed to programming. There's a difference. –  David Thornley Oct 6 '10 at 13:54

I started programming when I was 15 using Basic/Pascal and writing text adventures. I remember each room was a label and I used gotos to change room.

But no one was teaching me so I started from what I liked most (i.e. games).

My suggestion is to start with a simple language (Basic (not Visual) is still good for a very young one, or you could go with Python) and to avoid GUI stuff (too much boring generated code).

To enjoy programming when you are a child you need to "enjoy" it, even if you are using wrong tools (i.e. goto). Don't worry about bad habits: the child will eventually move on looking for more complex stuff to create and that will be a good point to teach him functions for example. If you give him enough time to enjoy programming, he will eventually ask for more. That worked for me, at least.

I don't think I would have become a programmer now if I had started with C++ or C :)

share|improve this answer
1  
+1 for "no one was teaching me". A 15 y.o. who wants to play with computers will learn by himself. –  mouviciel Nov 7 '11 at 14:59

Bash scripting would be good as I find the more I get into linux the more I want to script things and automate stuff.

If you want to teach programming, I would suggest something that is easy to grasp and easy to produce something. That something could be anything, but aside from specific languages I would suggest teaching some of the basics of specifications. In this regard, teach him/her an understanding that usually before you just start "cowboy coding" you want to look at the problem you have and come up with a reasonable solution (pseudo-algorithm if you will) for how to approach it.

This design fundamentals will be crucial to him/her not becoming frustrated with spaghetti code and learning to design before typing.

Python, perl, php, javascript are all good candidates to get up and running. If they take an interest to programming, maybe ask them what they want to tell the computer to do which will steer the course from there.

Best luck!

share|improve this answer

Josh K is on the right track. Starting out with a scripting language that abstracts away the actual computer he's programming won't teach him anything about computer programming; it'll teach him how to be a script kiddie who can't accomplish anything useful without copying and pasting other people's code. But anything C based will mangle his brain with horrible syntax and hidden gotchas. It's not appropriate for kids. Heck, it's not appropriate for adults!

If you want a way to teach someone to program, try a language that was designed to teach people about programming, like Pascal. Take a look at the Free Pascal project, which is available on several platforms, including Linux. It's an easy language to learn, and it's designed as an open-source implementation of Delphi, which is in wide use today in all sorts of important applications, so your student will actually be learning relevant skills too. :)

share|improve this answer
    
Pascal/Delphi is a decent choice; it's only downside is it's unpopularity. –  Paul Nathan Oct 5 '10 at 17:53
1  
Well, I don't care about popularity at this point... I just want to teach the concepts with a minimum of friction... I'm not ready to put his resume on dice yet :) –  JoelFan Oct 7 '10 at 11:45
    
If you don't want to "abstract away" the computer, a better target computer for learning would be something like the arduino and not a PC. –  Angelo Nov 7 '11 at 15:14
    
@Paul Nathan: Pascal used to be very popular. IMO this says a lot about how programming languages become popular and then are almost forgotten. I think that much of the popularity of programming languages is due to how strongly they are pushed by big software manufacturers. I think every programmer should try not to be influenced by fashion and concentrate more on the features of a programming language. Of course, I understand that a less fashionable language will have less tool and library support. –  Giorgio May 11 '13 at 9:32

Since he is so young. I would start with OO programming language like Java or Python. Teach him good practices, and so he doesn't later on begin with bad habits. Also being able to get around in a bash terminal doesn't hurt either trust me. Since I didn't till I started work.

Here is a link to a programming book free online for kids to start learning programming geared towards 11th and 12th graders, but again being ahead of the curve isn't bad.

How To Think Like a Computer Scientist series is amazing for beginners.

share|improve this answer
1  
Java is too verbose, and the OO skeleton is too evident. I'd say Python. –  David Thornley Oct 18 '10 at 14:29
    
Programming isn't all that hard to grasp. I started when I was 10 1/2. It just requires a passion for what you're learning. –  Timothy Baldridge Nov 7 '11 at 15:09

I would suggest something like Python to get started. There are a number of basics that can be taught in any language such as flow control, functions and variables, and for that purpose an interactive language like Python is a great tool.

share|improve this answer

I originally wrote this as if I was talking directly to the 15-year old who was learning programming...heh...I guess I'll have to read the question better next time.


As a homeschooler, and now a professional software engineer, I'd say it comes down to a few major things:

1) Find something that interests you and start a project in it. Back in the day I started with text based adventure games. Then I moved to a Star Trek themed "SpaceWar!" clone, from there I just continued to try new languages, and new projects. As a teenager, I mostly did game programming.

2) Find a good language...some here mentioned Python and PyGame...those are good places to start. From there I'd start reading up on the more functional languages (I'm a major fan of Clojure), as those seem to be all the rave these days.

3) Find your weaknesses and turn them into strengths. There was one time where I didn't know a IP address from a netmask. I decided..."I'm going to learn whatever I can about networking until I understand it enough to be able to write my own servers and clients". About a year later, I was doing just that.

As a general rule, try to exploit what I see as one of the biggest benefits of being home schooled: you have way more free time than "normal" kids do. When I was in high-school, I would get up at 8am (or earlier) put in a solid 6 hours of schoolwork and be done by 2:30. Then I would sit down and code for several hours. You're going to have to teach yourself, but that's a good thing. Most employers these days are more worried about experience than formal training. So if you can get experience in either working on your own projects, or on Open Source projects, that will look good on a resume. Once you hit 18, look for a good intern job, and once you get your foot in that door, there'll be no stopping you.

share|improve this answer
    
@JoelFan -- btw, if you want to talk off-list feel free to e-mail me through the e-mail on my profile. –  Timothy Baldridge Nov 7 '11 at 14:52

I started programming pretty young, and have since taught it. I absolutely agree with those who have warned not to start with a scripting language that abstracts too much of what is going on. Many such languages are useful to learn, but not as a first language.

A good first language is:

  • Strongly typed (meaning that you must treat integers like integers, floating point numbers like floating point numbers, characters like characters, etc.) Programmers who start out in loosely-typed languages tend to be missing a fundamental sense of the nature of data handling when they get to the point of designing data structures of their own.
  • Widely used in the professional world. There are a number of languages touted as "learning languages" that no one actually uses for production code...learning them will not teach one how to write good production-quality code. Many teachers have this idea that the code we write to learn to code should be different than the code we write to use: I really don't get the point of the learning phase if it isn't focused on the skills needed to write usable code.
  • Compiled (as opposed to scripting languages which are interpreted as they are run, rather than compiled into a binary executable first) Compiled languages, quite frankly, force one to write better code. You can make a very major mistake in a scripted language, and if you don't happen to try the thing that is broken, you will never know it. On the other hand, a seriously broken piece of code in a compiled language will fail to compile, forcing the coder to find and fix the mistake.
  • An open standard Any language whose owner keeps tight control over its use, who may write compilers, etc., such as anything from MS or Adobe, will have its own little perversions of the developer experience that exist not for technical, but for legal or business reasons. A good first language will have been put together with technical needs first, so that the developer experience makes sense, even to a newbie.

Finally, there is a lot of discussion about whether a procedural language or an object-oriented language should come first. I see this question as a matter of taste, though I lean toward object-oriented languages because an OO language can be used to write either OO or strictly procedural code if desired: the same is not true of procedural languages.

Languages I will not recommend as first languages:

  • Java (owned and tightly controlled, not open)
  • Python (interpreted, not compiled, and not typed let alone strongly typed)
  • Ruby (see Python)
  • .Net (not open, not strongly typed)
  • Mono (attempt at an almost-free .net, suffers from .net's issues)
  • Erlang (not widely used in production code)
  • Lua (interpreted, not strongly typed, not widely used)
  • Pascal (designed as a "learning language" not widely used in production)
  • COBOL, FORTRAN (though still occasionally used, not widely used today and mostly of historical interest)
  • PHP (interpreted, not compiled, not strongly typed)

I prefer to teach C or C++ as a first language. For those who say your child is too young: I was a 13yo living on a hog farm without much exposure to the outside world, except by internet, when I learned it.

share|improve this answer
1  
I almost forgot: get him involved with the open source community ASAP. Instead of learning in isolation from a book, this will give him constant contact with professional coders and their code, as well as get their eyes on his code. He'll be doing something good for the community that provides the software you all use, and learning a lot faster due to the interaction with more experienced coders. He might like Google Code-In, the successor to GHOP, a sort of mini-summer-of-code for high schoolers. It hasn't begun yet but info is at code.google.com/opensource/gci/2010-11 –  HedgeMage Oct 20 '10 at 1:48
    
I disagree with almost every aspect of this. Strongly Typed: that just adds more ceremony that distracts the programmer from actually getting stuff done. Widely used in the professional world) allot of interpretation here. Lua for instance is used in dozens of large video games (ever heard of WoW)? Compiled: they slow down development and don't normally allow for REPLs which encourage experimentation. An open standard: not a big issue. If a programmer is good at programming, he'll be able to switch languages in the future with little effort. –  Timothy Baldridge Nov 7 '11 at 15:07

Wikipedia has a decent list of educational programming languages.

If you were running windows or could set up a windows VM with windows on it, I would recommend looking into GLBasic. It combines the BASIC programming language, the OpenGL graphics library, and an IDE into one simple to use package. The premium version supports inline c/c++ (academic pricing available). Its also set up well for developing for mobile devices.

share|improve this answer

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