How To Teach a 12-Year-Old To Program?
thelordx writes "I've got a much younger brother who I'd like to teach how to program. When I was younger, you'd often start off with something like BASIC or Apple BASIC, maybe move on to Pascal, and eventually get to C and Java. Is something like Pascal still a dominant teaching language? I'd love to get low-level with him, and I firmly believe that C is the best language to eventually learn, but I'm not sure how to get him there. Can anyone recommend a language I can start to teach him that is simple enough to learn quickly, but powerful enough to do interesting things and lead him down a path towards C/C++?"
Python is multiplatform and is free. There are quite a few free tools and libraries available. It is a 'real' language that is at the same time suitable for youngsters to learn on. With the huge Python ecosystem that exists you can have them cranking out code in a text editor, an interpreter or a full blown IDE. (A wide number of them in fact). Python also makes for a nice bridge to C as it pretty easy to integrate the two. If you feel competent, you could probably just hit the Python docs and work your way through them. If you'd like a little help and have material already prepared for teaching younger people how to program with Python, there are resources out there.
I recommend Hello World! which uses Python. (You can read my full review of it here.)
If you don't want to buy a book, then you may want to look at Invent Your Own Computer Games with Python 2nd ed. I haven't read it myself yet, and a quick glance showed it to have some rough edges, but one can't be too picky at that price. It is available to download or read online.
It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
You didn't tell if he actually is interested in programming at all. Because if he isn't, he will never be. I tried to show programming for my little brother too, but he just couldn't be interested. It's something you need to be interested at, and if you are, you've probably picked it up yourself at that age. But maybe it's worth giving it a try at least, but don't feel bad if he doesn't get interested in it.
I started programming with Quick Basic. I don't remember exactly how I got there, I think I was doing "programming" like stuff with Paint or other such programs and my father instructed me to Quick Basic (this is when I was 7-8 years old). I remember having some game programming with quick basic book, that had simple examples and exercises. It was probably perfect for that age; simple, but still you got to see nice results. If i would had been dropped in to c/c++ instantly, I would probably had dropped whole programming thing.
Next logical translation from that was to Visual Basic, continuing on making own games, mostly top-down ones. It was nice to be in Windows environment, while still having easy language to go by. And there were DirectX libraries available too, and I learned first basics in 3D programming and raytracing. There were also some nice sierra style adventuring games game developing books released and I had couple of them.
Next step is more interesting tho. I had tried c++ for some times already, but I never really liked it. It was too much shit to get by, and wasn't that nice to develop with. I mean, I knew it and could code with it, but I really didn't want to. But I tried Delphi, and fell in love with it, mostly because of it's comprehensive component library, good help and nice coding. To this day I still prefer Delphi in GUI programming unless I really have to use C, it's just a lot nicer.
But the main point being, do not throw him right away to the nerdy shit that programming is. Get him started with the more easy programming languages first. There's a lot more such now a days too. Hell, don't except him to get to c++ programming ever. It's a limited area in work sense. Sure it's good to know it, but it isn't the best language or answer to everything.
Just let it be fun for him, and get him interested on programming on its own merits. Otherwise it's not going to work.
with canvas you can easily get graphics, and you can do network stuff.
The problem then however, is everyting else will seem like a total PITA..
Open a free bravenet.com account, and he can play around with Javascript using the included browser-based editor. If you've already got Excel, there's some interesting stuff that can be done with VBA that's not bad prep work for C and Python.
There's nothing particularly wrong with plain C as a first language. (I'd avoid all the intricacies of C++ syntax for a first-timer. The OO stuff is, in my opinion, totally unnecessary for a first-time programmer to learn.)
Another good language for first-timers is a scripting language like python or ruby. (I like perl, but perl's syntax is goofy, and if he does want to explore OO at some point, it's better to learn it in a language that uses more standard OO syntax.) I've used python as a teaching language in the past, and it works fine.
One thing to think about is what programming projects he's interested in doing, and make sure he's set up for success. A lot of kids that age want to program games, but programming a real-time video game requires a *lot* of skills. Whatever project he wants to do, make sure you have a combination of OS, development environment, and libraries that will work.
Find free books.
And neither would others.
PASCAL.. mediocre choice. C, okay... C++.. if you insist.
Python: pretty good, Ruby, Ada: great, Haskell/SCHEME/LISP/ML: EXCELLENT
If he has any interest in programming, then Python in combination with pygame is probably the way to go. Python is easy to learn, and pygame will give him instant visual (and audio) gratification. The instant gratification part is the really important bit if you want to keep his interest up.
"DRM is like the Ford Pinto: it's a smooth ride, right up the point at which it explodes and ruins your day."-C.Doctorow
Troll all you want, but VB is a good way to go for a starter language.
He doesn't have to master it, but use it to teach him the basics of UI, variables, ect. When I ventured into programming at 13 this was my entry language and I'm glad I took the time to learn it as it provided me with a solid foundation and left me prepared to move onto other languages such as ruby, C/C++, and javascript.
This is an example of a simple program I coded as a starter a few years back, it divides a total amount of pennies into change.
Public Class MoneyForm
Private Sub ExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ExitButton.Click
Me.Close()
End Sub
Private Sub ClearButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ClearButton.Click
Me.InputTextBox.Text = ""
Me.QuartersLabel.Text = ""
Me.DimeLabel.Text = ""
Me.NicklesLabel.Text = ""
Me.PenniesLabel.Text = ""
Me.DollarsLabel.Text = ""
End Sub
Private Sub CalcButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CalcButton.Click
'declare variables
Dim intPenniesInput, intDollars, intQuarters, intDimes, intNickels, intPenniesOutput As Integer
'get input from user
intPenniesInput = Val(Me.InputTextBox.Text)
'calc values
intDollars = intPenniesInput \ 100
intPenniesOutput = intPenniesInput Mod 100
intQuarters = ((intPenniesOutput \ 25))
intPenniesOutput = intPenniesOutput Mod 25
intDimes = intPenniesOutput \ 10
intPenniesOutput = intPenniesOutput Mod 10
intNickels = intPenniesOutput \ 5
intPenniesOutput = intPenniesOutput Mod 5
'display results
Me.DollarsLabel.Text = intDollars
Me.QuartersLabel.Text = intQuarters
Me.DimeLabel.Text = intDimes
Me.NicklesLabel.Text = intNickels
Me.PenniesLabel.Text = intPenniesOutput
End Sub
Private Sub InputTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles InputTextBox.TextChanged
Me.QuartersLabel.Text = ""
Me.DimeLabel.Text = ""
Me.NicklesLabel.Text = ""
Me.PenniesLabel.Text = ""
Me.DollarsLabel.Text = ""
End Sub
End Class
Once he's firm on coding things like this, move onto harder stuff such as C/C++
-P
"The difference between genius and stupidity is that genius has it's limits" - Albert Einstein
Get him a Propeller micro controller kit from Parallax Inc http://www.parallax.com/tabid/407/Default.aspx A Propeller is a 32 bit micro-controller (well in fact 8 processors in a chip) with some RAM. Parallax have a number of ready made boards so that this thing is easy to program from USB. The IDE is dead easy to use. Starting out the first steps in programming with this is inspiring because one can immediately get things in the real world to happen. From flashing LEDs to controlling robots, to generating video. The high level language it uses, Spin, is sort of Pascal/Python/C like, very easy to begin programming with. When you get serious it's assembly language is about the easiest there is. The Propeller does VGA and TV video, there is even a games oriented kit. It's the closest thing we have to the C64 we have in this modern world. Wish I had one when I was 12.
It's really easy to get started, and there's an online, interactive ruby tutorial
At 12, I think you want to impart a good foundation, not expertise in a specific language. I learned BASIC on a C64 back when I was 5-8, and followed it by learning C and C++ in my early teens. I think BASIC remains a reasonably decent starting point, in that you'll be teaching the rudiments of loops and program flow without the complexities of pointers, but depending upon the learner you may want to dive into C immediately after walking through the basics of BASIC. C# would arguably be the logical replacement for C++ in a new programmer, these days. If he's like most kids, you could even teach both C# and XNA, and work with him on learning to write code via a small video game project; if he has a Windows PC or an XBox, he can even show it off to his friends.
We who were living are now dying
With a little patience
Many still recommend Logo as an early teaching language. It's quite visual.
Table-ized A.I.
web programming. Set him up with a web server where he can work on projects to show off to his friends. I believe that in the beginning learning how to express yourself in code is more important than what language you're doing it in....
Instant gratification + something cool to share with friends == success and satisfaction.
I wish you luck...
I've signed up as a mentor to teach programming to an interested High School senior, so it isn't a 12 year old. I chose C because, frankly, it is what I know best. Java might be appropriate also but for starting out I think C is a better bet than Java. (I can't address Python since I've barely coded in it.)
The teacher had a copy of K&R, 2nd edition on the shelf. I had them order a second copy for me. We'll start in Februray. Meeting about once a week for the rest of the term but staying in email and Skype video contact.
Wish us luck!
I whould go with FreeBASIC (+FB IDE) It's open source, it's fast, it's pretty close to QBasic, but has pointers, OOP and all other modern language stuff. Also, tons of libraries are supported (OpenGL, etc...)
Set him up with something where he can produce something cool, FAST, which will enforce best practices. Frankly, the IDE is more important than the language. Set him up to where he is asking "Why and How", not "what the fuck do I do now?"
He'll need an idea of something to accomplish, and set out on a path to get it done. Learning programing without a specific goal, is another kind of hell. Make it about the 'Solution', then show him how to get there.
Firstly he has to want to do it, I mean really want to because it is hard. Show him this its pretty inspirational (what ever you think of the author), this got me into programming.
Peter Norvig says Python or Scheme (he's an old lisp guy) but he needs to get to the point of codding his own apps ASAP so a language with lots of examples is good (Python has the oreilly publishers cookbook and numerous applications out there).
How To Design Programs
Really. If he is interested in programming and you can guide him to follow the book, then he will know what to expect from a programming language, get a a good background and will not need to unlearn bad habits.
I wasn't taught how to program by someone. I discovered QBasic in DOS myself when I was 13 and was automatically drawn into it. I liked programming graphical things the most (plotting pixels with PSET). The fact that such graphical things were possible is what interested me so much. I'm not sure how this is with other people, but programming boring text examples makes it uninteresting probably.
You don't want to raise a sissy, do you? DO YOU?!
:D
It has to be Perl, of course.
That way, he'll either write Haikus and become a rock star programmer, or write Haikus and go raving mad and prove the rest of Hilbert's unsolved problems.
Either way, you'll have Haikus, either as errors or from your brother. You can't go wrong with that!
Depending on your kid's preferences, there is a good chance that he likes to make games. I find that Game Maker can be a great starting off point for a young programmer--it has a simple, graphical interface with a simple programming UI that, while drag and drop, still programming logic and structure. Then have him graduate to using GML, which is the programming language included with Game Maker. Its syntax is very similar to C and C++ and, at least for me, it proved to be an excellent introduction to programming.
MIT's Scratch http://scratch.mit.edu/ is a remarkable environment that will allow for young programmers (as young as 6 and 7 ) to become familliar with subroutines, variables, conditionals, message passing, etc. in an environment that makes it easy to express things visually. For a 12 year old, it might be worth a month of exploration in that environment, then on to a conventional language.
Paper tape reader sold separately... :-)
Speaking as a programmer who followed that "royal road" of BASIC->Pascal->C->and beyond .... But that was 25-30 years ago!
Today: Lead him AWAY from C/C++ and towards VHLLs (you choose, there are so many good examples).
In fact *start* with a VHLL. Scheme would not be bad. There are plenty of other suggestions in other comments.
Imperative programming can be a limiting paradigm and difficult to grow beyond. It is better, imho, to be exposed to a variety of paradigms, especially functional and declarative, early in the learning process.
you had me at #!
By "interesting things", we'll assume you mean interesting to him.
Given his age, that probably means something webish, so Javascript is the obvious choice for the kind of instant gratification a 12-year-old will need.
If he's into games, then the language of choice is probably whatever will let him mod his favourite.
If he likes to play with numbers, it's VBA and Excel--or R.
Is he into computer graphics (not digital painting)? Then you want to introduce him to Processing.
Lots of choices
I'm a Programmer. That's one level above Software Engineer and one level below Engineer.
Tell the kid there's something nifty hidden on the computer, but that he'll need to write the tools to get at it. He'll be learning to code in no time flat. :)
~REZ~ #43301. Who'd fake being me anyway?
http://scratch.mit.edu/ is a good place to start, I would think. Let him do some of that and then when you start to hear, "I wish I could do X", point him toward something more complex. I've seen Python and Ruby both suggested as that next step, and I'd add Perl to the list.
Skip Franklin
It's always darkest just before it goes pitch black. -- despair.com
Python is a very good suggestion. Be sure to check out the turtle module (included in the Python standard library), it's quite nice and inspired by Logo.
Also, Python 3.1 is slightly simpler and easier to understand for a beginner that the old Python 2.x.
There's a hidden treasure in Python 3.x: __prepare__()
Show him what you can do with programming. Show him something cool, which is still reachable so he can imagine himself doing that. Just some lame "you will get good jobs after 100 years" thing doesn't fly I think. For me the "defining moment" was when I saw Scandinavian "demo-scene" stuff at the age of roughly 11. After that, I really died to learn 3D-programming, and I've been coding pretty much every day since. :) I started with C, but it seemed so complicated and difficult to learn that I moved to x86 assembly, and learned that way. Couple of years later of course moved back to C, but that time with different perspective already -- as the projects grow in complication there was need for something more high-level. Pretty much same way ended up in OO-programming, I noticed I was more or less doing OO-programming already but just cumbersome way, so transitioned to C++... But anyway, get books, lots of them. I've met some programmers who have never read a programming book, but I still believe clearly organized and though-out book is a much better way to learn something "right way" even if basically all the information is in Internet.
My suggestion would be - show the kid what he can do *with* programming, then see what he likes best and then choose an appropriate language / environment for him. If he's graphically inclined, you might want to start with e.g. Flash. If he's fascinated more by how quicksort works then maybe Haskell or LISP.
Python can do all those but it's for people who already know what they want.
-- Sig down
It was good enough 'then', and would still work the same way.
If he is put off by it, perhaps LOGO (Yes, the one with the little 'turtle' that you program to move around and draw lines.
Seriously.
You get immediate visual feedback; and it is properly structured unlike basic. Move on to pascal afterward, then C.
In my opinion, Scientology is a cult you should avoid.
Why not try Free Pascal and Lazarus? You can use a lot of the material found in learning Delphi 5+ books for it. Is fully object oriented. It is seriously cross-platform also.
From: http://wiki.lazarus.freepascal.org/Overview_of_Free_Pascal_and_Lazarus
Free Pascal (FPC) is an open-source Pascal compiler with two notable features: a high degree of Delphi compatibility and availability on a variety of platforms, including Windows, Mac OS X, and Linux. Free Pascal's compatibility with Delphi includes not only support for the same Object Pascal programming language that Delphi uses, but also for many of the same libraries of powerful routines and classes that Delphi is justly known for. This includes familiar units such as System, SysUtils, StrUtils, DateUtils, Classes, Variants, Math, IniFiles and Registry, which are included with Free Pascal on all supported platforms. Free Pascal also includes units such as Windows, ShellAPI, BaseUnix, Unix and DynLibs for accessing features specific to an operating system. These dozen or so units make up the core of what is usually referred to as the Free Pascal run-time library (RTL).
Lazarus is an open-source development system that builds on the Free Pascal compiler by adding an integrated development environment (IDE) that includes a syntax-highlighting code editor and visual form designer, as well as a component library that's highly compatible with Delphi's Visual Component Library (VCL). The Lazarus Component Library (LCL) includes equivalents for many of the familiar VCL controls such as forms, buttons, text boxes and so on that are used to create applications that have a graphical user interface (GUI).
leather-dog muksihs
Blog: @muksihs
My son is just turning eleven and his "wish" for his birthday is to get his own computer(his last one died a few months ago) and learn to program.
1: Linux. Learning a in real hard-core operating environment like this is very similar to what we had to do in the 70s and 80s where everyone built their own box and had to do everything from scratch. Also, it's a lot like those old electronics kits - you learn the basics that hard way from the ground up and you never have to worry about it later on. That said, I suggest Mint or something fairly streamlined and possible to live-boot in case he nukes the box with his fiddling.
Also, such skills will be in great demand a decade from now when he's out of college and ready to get to work. There are book-learned programmers and then there are those who understand the science and technology behind it as well. This only happens if you start early and with the very basics and don't cut corners. (that aside, it does amaze me how many computer savvy people can't even do simple things like fix a power supply - or even change the oil in their car)
2: Perl and HTML to start, then a few specific programs come to mind. Pov-Ray is complex but also is free and requires some skills that are very useful later on. Another good program to look at is NetHack/Angband/etc. They are old now, but they represent a great crash-course in entry level C programming. From there, have him work on 3-D programs ( look up "Mandelbulb" ), networking, and anything else that you can find that stresses math and programming skills over eye candy. You can also have him work on constructing levels for older games like Unreal Tournament or Halflife later on. Old as they are, they still are great to make mods for.
Get him to use Linux, and if he likes that, then start explaining how things work. Get him to do some basic stuff with sockets in C once he's comfortable with a Unix environment and the curiousity will evolve naturally. I would personally not put him in contact with any higher level programming paradigms just yet as he might get overwhelmed with way too many concepts, let him get used to the way computers work close to the hardware first, then introduce him to object oriented programming using a language of your choice (I would follow with C++, but that's my preference) and then slowly introduce dynamically typed languages and functional concepts to him. Whatever you do, just make sure that his bases are all properly laid before moving on to the next level. I believe C is a good starting language because it abstracts the programmer from architecture specifics without abstracting them from the fundamental way all computers work, and people get motivated when they understand that what they're playing with are the tools that everyone uses to build real stuff.
Your question has a lot of what you want, not what he wants. So ponder that for a moment: if he doesn't have any interest, you're wasting both your time and his time, plus causing aggravation and friction. Ask him if he's interested, ask him what kinds of things he would like to develop, and go from there.
Javascript, by the way, is the new BASIC. It's ubiquitous and you can get results quickly.
I'm completely atypical in this respect, but I first learned to program in x86 assembly. Why? Because I was poor and the only computer I had was an XT clone that was given to me. I had no development tools except what came with DOS. I'm 27. I think the absolute best thing you could do is give him a computer to experiment with. Provide all of the tools for development, but don't try to prod him into your following. If the interest is there then curiosity will spur the pursuit.
I highly recommend teaching basic principles in whatever random scripting language you can do something *interesting* in. There are a few different systems online that allow you to script "bugs" or "tanks" or whatever kind of character around a map. They use a simple scripting language that will at least handle loops, control statements, and the concepts of variables and methods. More importantly, they give the new learner *immediate* feedback on what they're doing. Or you could go more into the physical world, and start in Interactive-C and Lego.
The most important thing when you're first learning any skill is getting immediate "fun" reinforcement out of it. No matter what language you learn, it's going to be a lot harder to stick with it if all you can *do* with the language is print out text on a command line. Once they're doing interesting things in their wimpy scripting language, give them a harder problem that is a pain in the butt to do in that simple language, and show them how a more powerful language (and more powerful concepts, like object oriented programming) can help them do it.
IMO, people worry far too much about teaching good design or a specific language early. Get them thinking about problems like a programmer first, then start showing them how good design or a different languge will make those problems easier to solve.
That's the truth like you did, like you gathered all the pieces together to write programs. It's best done in his own way and pace of learning.
What you can do, is to assist him, assisting is someway different from teaching :) keep that in mind.
Give him a selection and let him choose, or go with him to a bookstore.
And if he wants c#/c++ let him buy a book (bad we had xmas) he can download the express edt of visual studio on his own.
Btw. for "Pascal" there is Turbo Delphi, given away at no cost from Borland/Inprise/Borland/Whatsoeverjustthemakersofdelphi, no real draw backs known, except some strange stuff nobody's using ;)
#include int main(char * argv[], int argc) { fprintf(stdout, "Hello World!\n"); return 0; }
Open Simulator (which is what OSGrid runs) and Second Life both support LSL, and you can see tangible results from your code almost immediately after writing it. This will probably be a little bit more attention-holding than your typical hacking environment.
Furries make the internet go.
The ideal programming language IMO to start him on is to make it clear that unix itself is a programming language, and show how it underlies so many modern electronic devices. Programs are functions, files are variables. I'd start by having him write some stuff for the command line. My first instinct to suggest is ruby, and I can't be objective on it but perl has always been a lot of fun for me, and then python, objectiveC, C, etc.. are all good options. Bash scripting is important to cover and mention from time to time but I'd not use it for a primary language.
The important thing is what you do with it. I don't know your son but in general the best way to grab a child's attention is by teaching them how to control something visual or audible and potentially cool. With this in mind, Javascript is another excellent choice due to the ease of changing visual elements and the natural lead-in to complexity. But there's a lot of noise between the differences of various html/css/javascript implementations so pick one and stick to it while he's learning - though a second well-chosen language would be helpful to teach generation of documents / programs / whatever in that second language.
He'll have a fascinating device, he'll learn lessons in morals and human ethics for the entire world, and he'll learn more about how things work in both software and hardware than any Windows/Microsoft environment can teach him. It also won't run the latest Windows shooter games, but will allow useful browsing, networking, and access to data to actually do programming with.
C and Scheme are the "closest to the metal", meaning that they're the purest expressions of procedural and functional programming. He'll be most likely to learn good programming habits using those. But he pretty much needs to be interested in programming for its own sake to succeed with them.
If he wants to do games, just bite the conceptual bullet, get an account for developing iPhone apps and let him use it. Or try out Android. Give him as much help as you can, but don't sweat getting him the answer for every question. Teach from your expertise, which is knowledge of general principles. He'll be teaching you the gory details in six months.
-------
Theory blazes the trail, but it can't pave the road
Adobe's ColdFusion...
Here is why...
It is very close to pseudocode, the language itself is nearly logic.
Examples:
Albeit the language is slightly more verbose. It is a rapid development language allowing for very fast production of smaller web projects. As skills develop your 12 year old can move to CFSCRIPT which is very similar to JavaScript and other C-syntax languages. But ColdFusion will allow a very easy entrance to programming concepts. Conditionals. loops and arrays. They can then progress to MVC model frameworks in ColdFusion. ColdFusion itself utilizes Java. Once they get the basics they can expand into the Java world.
I am sure there are some who will advocate going straight into a language like Java. But I think breaking up the learning of logic and the learning of syntax into two steps is very prudent in education. ColdFusion adheres closer to logic in it's syntax. It has not been super-optimized for coding efficiency.
ie: versus if(x=y)
But it's syntax is less cryptic. It is also very easy to work with SQL databases in ColdFusion. This allows the 12 yr old to start being productive much earlier than they would in something like Java. And once they have an understanding of 0the logic and design patterns they should be able to move to any syntax. Hence why I think CF is a good language. It greatly reduces syntax issues adhering very closely to logic based pseudo-code.
This is vague musing hoping that someone else can expand. The BBC Micro's BASIC had a series of plot and draw routines built in. It was fun actually getting something tangible out of very limited beginner's knowledge. Not sure whether something with built in OpenGL would work. The basic GL operations are very flexible and easy to understand. Downsides are that actually setting up a window is a more effort than just typing "MODE 0" and glut is slightly distracting from a low level understanding.
The only advantage C has as a language is speed. It is difficult to read and relies on the programmer knowing enough not to shoot themselves in the foot. C++ has bolting upon bolting upon bolting of things in order to deliver OOP, and its primary advantage is the speed of C: it is semantic/syntactic goulash.
As to today's problem, I gather one of the unspoken issues is picking a language the teacher knows well enough so as to answer the student's questions. Assuming from the phrasing of the question that the asker would like to know the better imperative languages to teach, then, maybe python is the answer. I've heard reports from a teacher of an undergraduate course that the students respond to it fairly well.
But that brings us to another issue, the age of the student. How we learn differs as we grow through childhood and adolescence and the best language for an 18 year old may be totally unsuited for a 12 year old. Logo and SmallTalk (Squeak) are languages and runtimes which teach children the message and response paradigm of computing application. The Carnegie Mellon people are really excited about Alice as a teaching language.
The way I look at it, one doesn't teach children about chemistry by launching into the shell model of electrons and discussing valences and bondings. No, one puts some lemon juice on baking soda and then explain what the child saw and in simple terms. Regarding teaching computing and an introduction to languages, I'd want to not bother the child with memory allocations and deallocations and I'm not sure the entry form bias of the Visual languages is all that energizing a subject matter. Interactively creating objects, moving them through space, and causing them to draw seems a lot more promising for introducing a child to the concept of programming.
My solution to this problem that I've been working on for years, but still has further to go is LiveDVD linux distribution, that includes all the source code to rebuild itself (the iso image) from scratch. Add to that, a cool interaction with some NDS homebrew, including all the source and compilers needed to modify that. Currently what I have is a fedora derived LiveDVD/USB that boots a PC into an electric guitar-f/x preamp, which when combined with speakers and a guitar, lets you easily start jamming with Rakarrack. For the NDS homebrew side, I have an application that lets the NDS talk via wifi to control Rakarrack in realtime. A TouchScreenWhammyPad implementation.
For the long term goal to achieve what you described, I intend to add more simple GPL homebrew games, and a book walking a kid through the process of tweaking some little aspects of the existing games, maybe just text strings. That would get them familiar with the development process. Then maybe a complete tutorial implementing tic-tac-toe or such (from good overcommented template code of course).
If you want to check out what I have so far-
http://gzyx.org/
(developer build of new f11 based version will upload today, and an f12 version should be coming pretty soon)
I would guess that at an early age you should appeal to their interests, if he is into "web2.0", social networking and that kind of stuff I would guess ruby and lead him towards ruby on rails later on, nice loving language, powerful framework.
If he like games, python and eventually teach pygame or pyglet. Maybe you'll put competing together in PyWeek as a goal.
If none of the above applies but he have a general interest in computers, Haskell is just a jawdroppingly beautiful language. Functional and typed. I just love it. Graham Hutton: Programming in Haskell is a great book for learning Haskell, and if your looking for an online resource there is always Learn You a Haskell For Great Good
The demographic already has a great deal of preconceptions about how to train a 12yo to program. My kid is only 5. Go back and edit the post to capture a stronger market demo...
Reality is prettier inside my head...
Check out http://javabat.com/ for coding practice (the *teaching* of the material is still a problem, but JavaBat is great for practicing)
It must be fun, otherwise he won't continue doing it. And building robots and making them do things is fun. But there is of course a price to pay - literally.
My opinion? See above.
I taught my brother a bit using KPL, but looks like it has been replaced with Phrogram To me, it was like what I could do in BASIC years old - a few lines of code to draw some cool shapes then animate them. Very minimal meta-programming (importing libraries, using statements, make scripts, etc.) I actually was using it and feeling kinda jealous, like "why can't I be this productive in real languages?" It was a heck of a lot of fun too.
The first thing i learned to program was the TI-83 calculator.
The programming language was pretty simple and easy to understand. You don't even have to make anything complicated to learn how it works. Just write one line and run the program, see how it works, fix it, and try again.
Go for the TI-83 calc
Reward his bossiness and ridiculous demands, he'll become a high paid manager of C++ programmers in no time.
Create the perfect motivating balance between too hard and too easy. The more close to perfect, the more motivation it will create.
That can really be all there is, so someone has fun, is motivated and interested.
Of course you can make it into a game, by
seeing it as a toy (something that you manipulate out of curiosity, and that is fun [happiness with surprises]),
and then creating goals to be reached by problem solving. (Usual goals are, to understand/learn interesting things, and to have fun.)
I’d say some LEGO robotics, controlled by Python, should be a fun toy. :)
And creating “levels” with goals, obstacles and surprises, and an end boss/level should make it a good game.
Add real rewards with a value, and you got tons of motivation too. ^^
P.S.: Be sure that you teach him social dynamics and how to handle girls with the same approach next year, so he does not end up in your basement. ^^ (Programming and being good with girls are not mutually exclusive. That’s just what we are socially conditioned to think. But what stops you from doing both? Nothing. You just have to allow yourself to go full scale. How hard is it, to decide that you will be like that. And then just be like that. :)
Any sufficiently advanced intelligence is indistinguishable from stupidity.
It's not free (by either definition), but it's the best thing for what you're talking about. It has a class-based language with similarities to Java and VB.NET but easier to learn, a simple 2D sprite engine that lets you write games immediately so you get positive feedback right away, and enough APIs to be able to do interesting things once you get somewhat sophisticated.
like Stagecast Creator.
...teach them the CMD-environment batch file language, which became a real computer language sometime around 2001 and becomes better and more powerful with each successive iteration of Windows.
I recommend Crobots. It is a fairly simple game where you create a program that operates a robot on a battlefield vs another robot that someone else has written. Limited C syntax but it has the basic programming structures. Way back in the late 80s I spent all summer building robots with Crobots.
While I worked as a special education assistant, I showed KAREL to a few students, and they were not only interested, but they found it fun.
Someone flopped a steamer in the gene pool.
I know two programming environments, designed specially for children. One is Stagecast Creator http://en.wikipedia.org/wiki/Stagecast_Creator, which is created in Apple, and was known as Cocoa before Apple reused the name for the Cocoa API. The other is Alice http://en.wikipedia.org/wiki/Alice_(software), created in Carnegie Mellon, by a group led by the late Randy Pausch (you might have seen "The last lecture" by Randy Pausch).
Stagecast creator is a programming tutorial, disguised as a 2D game designer, and Alice is a programming tutorial disguised as 3D scene creator. I, being a keen NES gamer, tend to like Stagecast better.
Yoyogames gamemaker (http://www.yoyogames.com/) is an incredibly fun platform to learn, and its OO. Scratch (http://scratch.mit.edu/) is even easier. For more of a challenge try java or python. A challenging but very interesting intermediate-beginners project could be: design Conways Game of Life (http://www.ibiblio.org/lifepatterns/).
I am a computer science junior at RPI, and they start with C++ there. This way he has something that people actually use. A lot of the languages are quite similar as far as basic syntax, so it doesn't really matter which you start with, and C++ allows for the use of more complex programs to be written down the line. I would also like to mention that 12 years old is not to early to start, but even if they are not interested at that age, it doesn't mean they never will be. I have a few Mathematics major friends who have become interested in programming at the age of 19.
I'd say starting off with any programming language, even the easy ones, is quite boring and it seems very far until you do anything "fun". I would use something like a scripable game, like say NWN2 or similar. Let him figure out the basics of variables, assignment, branching, looping and state from there and the result will be a little quests you can play. If and only if he's got interest in that I'd start him off with a real language. Pick something with a nice IDE so you don't have to know the standard library by heart, vi and emacs is so last century even with syntax highlighting. Then you can give him a bit more clues on memory management as appropriate for the language (RAII is vital to C++, for example), creating GUIs, read/write files and send/recieve over the network. That should cover most the basics, I'd leave databases alone unless he really wants to make something best driven by a database.
Live today, because you never know what tomorrow brings
Does it really matter? I mean, I started programming when I was 9 in m68k assembler and at 11 I had somewhat Mastered it with extreme proficiency. From there I pretty much learned any other language I fancied.
I don't think the language really matters as much as the aspiration to program.
Change is certain; progress is not obligatory.
I am sure someone has already posted it by now, but this about this.
What is the goal of programming?
To learn about objects, methods, functions, variables, loops, arrays, program flow, statefulness, events, design, and concurrency (threads).
You can do all of this in Alice from CMU. http://alice.org/
Alice starts out as fun which is a great hook and quickly changes to a programming environment as you want to build more complex worlds. Once students understand all the abstract concepts of programming then you can spring C, C++, Java, or whatever. Alice is nice because you only have to learn one level of the abstraction at a time and not wrestle with programming syntax. Having to deal with two abstractions (syntax + programming concepts) will lead to disinterest because it is HARD, even for people who like it.
I also recommend getting a Lego Mindstorms NXT. You can run nearly any language on it.
Assuming you'll be heavily involved and you know Java (or are willing to learn), I'd go with Java+NetBeans (or Java+Eclipse, or whatever). You'll program the framework (like a canvas for drawing), and let your brother to put the meat into it. Don't try to do any object oriented stuff, just imperative programming that happens to be in a class method. You'll provide a class with just one empty function with the canvas (or whatever) as argument to start with (and "throws Exception" so he doesn't need to worry about those, and whatever else secondary comes up). And then, program away.
Using Java above is beside the point. The real point is, good IDE will show typos and syntax errors, and provide immediate argument help for any functions he wants to call, and has "scripting language feel" even though it's compiled. Oh, and teach him to let the IDE auto-format the code. That way he'll learn to look at correctly formatted code, while not being burdened with having to be pedantic himself, and he'll learn that if auto-formatting formats the code wrong, then there's a syntax error. I'd go as far as to bind auto-formatting to TAB key... In general, let him skip the required pedantry of any modern, complex programming language by letting the IDE show how it's done. Java just happens to be one of the languages with best free, modern, fully-featured IDEs, while not being the horror known as C++...
I wouldn't recommend Python, it's too big and complicated for a first language IMHO, and I don't think there are good enough IDEs (or good enough Python support in existing IDEs) to compensate for it. Once he know the basics of programming, then python+pygame or python+pyglet can be a lot of fun, but getting started with them has the risk of getting frustrated with run-time exceptions that should be compile-time errors, manually keeping the indentation right, and perhaps too many complex concepts to start with.
HTML fascinated the hell out of me, so i tried it
HTML hardly constitutes "programming" in any reasonable sense. That's not to disparage knowing it as a skill, but regardless of what some people think, it's not programming.
made some Pokemon websites
Okay, now you've definitely blown your case. ;-)
"Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
Javascript is for pussies. Teach him brainfuck.
HTML is markup, not programming. And PHP? Come on.
"Oppression and harassment is a small price to pay to live in the land of the free." -- Montgomery Burns.
My father's solution was to give me a copy of K&R's C Programming Language. It was slow going at first, to say the least. I found other C books to be a great help, particularly O'Reilly's Practical C Programming. Things that weren't explained in a manner in which I could understand them in K&R, were explained there quite well. But that's only useful if you think he'll enjoy pushing bits around like I did. Other, more high level and graphical stuff will probably be quite a bit more appealing if he's not really interested in writing stuff for the command line.
"Upon attaching the waterblock to my penis, I began to notice that I know nothing about computers." -- JRockway
Buy him a copy of C Primer Plus (5th Ed) by Stephen Prata and work through it with him. In my opinion it is one of the best introduction to C books available, if not the best and very friendly to first time programmers. Another option is Java: A Beginner's Guide (4th Ed) by Herbert Schildt.
I too believe that learning the lower level things such as memory allocation is the best way to make yourself a better life long programmer so I would advise C over Java however I know a lot of people who only know Java (or C#) and do just fine however they knew next to nothing about what I consider to be "real" programming. Everything they do is drag and drop then writing some logic to handle an event and letting the runtime deal with the "nitty gritty" stuff.
It doesn't really matter what he learns to program, but to teach a young man how to do something, the best motivator is, i think, a competitive challenge. There are many ways that programming can be applied in such a fashion: botting games, the games which are, in fact, programming exercises, and things of that fashion.
The idea is to make it interesting, and interested people try to find solutions.
Then just make sure you break him of the habit by making him write some sort of ERP platform, so he can grow up normal and find employment.
~/ssh slashdot.org ssh: connect to host slashdot.org port 22: too many beers
When I learned the basic algorithms, we used Pascal. It had just a few quirks, so you can focus on logic. Subsequently I ended up mastering both C and assembly language fairly quickly and fairly well, and those became my main languages.
Since Pascal is essentially passe, I would recommend some minimalistic interpretive language instead, like Python, as a starting point.
Or just jump into java with something like: http://www.greenfoot.org/
Though personally, I don't like the whole "objects first" concept.
Depends on how motivated the person is and whether they need the "I made a game" reward, or whether "I made the computer do what I wanted" is enough.
Without actually thinking it through, the original Freedom Force game (2002 so will run on basically any modern machine) used python as the scripting language. You could do pretty neat things with small amounts of code and you got a "fun" test environment. But it's been a long time since I looked at that, there might be some drawback I don't recall making it a PITA.
When I was twelve, I moved from QBasic to C. C isn't that difficult to understand. If the child doesn't show any interest, don't push him/her. It takes a certain level of curiosity to like programming. It isn't for everyone. Choosing a dumbed-down toy-language doesn't make a difference, but being a good teacher does.
Consider "Python Programming for the Absolute Beginner" by Michael Dawson. Python has the advantage of making sense in the same way that mathematics makes sense, so learning the language may have the additional bonus of helping him transition from computational math to algebra. As for the book, it has an extremely high rating on Amazon. One reviewer (C.L. West) states that he taught his nephew using this book.
I have two babies and I'm always wondering how I'd teach them programming. The conclusion I came to is that I won't. Instead, I'll give them a computer and let them take their own path. For all I know, they'd eschew the programming, but go on to become amazing digital artists.
If they are truly interested, they'll find C, or Java, or whatever, all by themselves. And daddy will be there to guide them along that path after they've found it.
There really is not enough info to give you advice:
- has the kid voiced any interest at all, or are you more or less forcing that on him ? In the first instance you may go relatively hardcore, or at least art for art's sake, sooner, in the second case, you need a bit more demagogy. ...
- is he interested in scientific stuff in general ?
- does he do anything on a PC that may get him hooked, like play on a macro-able game, draw...
- does he play with any programmable stuff, like Lego Mindstorm...
- have you ever done anything else with him, or are you just trying to hook him up to so that he'll leave you alone with that "baseball" thing ?
-
The Cloud - because you don't care if your apps and data are up in the air.
I've also seen similar questions having lots of great voted answers on StackOverflow.com. For example, see these similar questions: http://www.google.ca/search?q=Teach+Year+Old+To+Program%3F+site:stackoverflow.com
"I've got a younger brother who I'd like to teach to program"
Why? Unless he comes to you, don't do it. You'll put him off for life. The best you could do would be to find out what he's interested in, and then do some of that on your own, and let him see what you are up to. See if he bites.
Otherwise you might as well "like to teach him physics", or math, or shakespear.
So, does he play shooters? Teach him how to script bots / gameplay in Unreal Script. Is he on youtube a lot? Teach him video editing tools. Ok, not programming, but technical. Interested in 3D? Get blender. Teach the math for raytracing. Facebook everyday? Teach him the API to write a cool app. So many possibilities.
The syntax is simple. The basic operations are simple. The concept of 2 stacks to work with is simple. There is a core of operands/words (libraries) upon which all else is built. There is free on-line documentation available, as well as free versions that run under DOS, Win32, and Linux. It can also be easily extended later with C language. Even FORTRAN translates into FORTH without much pain. It a great learning tool for programming, and even if FORTH, along with C and ASM, is all your youngster learns, he or she could have a good future in the embedded programming field.
Actionscript is like C/C++, but with protection from some of the nastier stuff. Also, if you want to get straight to displaying graphics, I haven't found a language as easy to do that with. The most important thing is that Flash games are actually pretty cool so if you become a master in Flash over the years, you can crank out some games. I coded Basic since the Ti-99 in 82, through C64 basic in 85 to GW basic in 91 to quick basic in 92. C/C++ from 95-2009, and now I'm on Flash which I picked up in a week.
I think the secret to any object oriented language is to avoid complex memory references as much as possible, and just stick with dumb arrays and procedural programming as much as possible. I'd say it is possible for a person to code in Flash without knowing any OO concepts at all as long as they have someone to spoon feed them the basics. Another tip: If you code small chunks at a time, you almost never get caught blinded by where the bugs could be... They're most likely in the new code you wrote!
God spoke to me.
Every computer that a 12 year old has access to has a ready-to-use javascript interpreter sitting right there on the desktop. Probably several of them. And they're all unrestricted enough to use for beginning exercises.
There may be more legible languages out there, and there are certainly better "learning languages." but Javascript has an attractive price and portability, and the child might be able to write something that is genuinely useful, and of course show off to the class.
You can't force programming on a 12-year old, it's hard enough "forcing" them to learn anything at all at school. You just have to remove the barriers and let her find her own way. Make sure to leave some "entry-level" books lying around and provide guidance when asked.
Can you be Even More Awesome?!
Don't be disappointed when your kids (or little brother in this case) is far less interested in programming than you are. You may never be able to inspire a kid to like coding as much as you like it yourself.
It can be really tough to share your favorite hobby/occupation with a kid and not have him/her respond with the same passion for it that you had at that age. This happens to musician parents who try to teach their kid music and find out their kid just isn't that interested. And it is no different for us programmers.
Sometimes a child will express an interest in programming. But don't be fooled, asking you about it is not the same as having a passion for it. And don't get upset if down the road the child wants to do something else instead. Be happy that they had any interest at all in the things you enjoy!
Just make it fun and let the kid drive the direction of the teaching. You cannot rush this. If you try to dump decades of experience onto a kid in a few weekends it will seem like work to both of you. If the kid turns out to be serious classes or computer camp or something where they can learn and socialize with peers can be a great way for them to keep going forward and improve their skills.
“Common sense is not so common.” — Voltaire
http://groovy.codehaus.org/
An interpreted language for sure -- Python is a good choice, but not the only one. Adding the complexities of compiling and linking are wholly unnecessary for a beginner. And preferably something with a decent development interface. But as already noted, only if he's interested. If he's not, buy him something physical and extensible instead (eg Lego)
If you like LISP, you might want to look at Clojure. It is a LISP variant which generate Java byte code. The of that is that you have all the Java infrastructure available. You can use it to write Tomcat / Jboss and other application server modules.
Start him off with fortran.
JavaScript never stops being fun. And you can actually impress girls with cool stuff you can do with JavaScript on a Web page. Not many computer languages can impress girls.
I would like to recommend (1) C, and (2) Python. NOT C++, or Java AT any price.
...
Reasoning C, is simple and short to define and understand and is well supported with debugging tools ddd, and gdb, which now has reverse debugging and he will also learn about the POSIX api. Python is very clean, and 2.6 up has a very good Object Model and Library. It is the best language for people entering OO mode. Programmers who know C, Fortran, Cobol or Pascal seem to transition to Python easily. It also gas good built in debugging tools, just not as good as Perl, which continues to irritate me.
No way start with C++, Java or Pascal. C++ + StdLib + Boost is just too complicated, and every iteration of the Standard Committee seems to make things worse, the two Scott Myers books are very useful and I ensure that anyone working on a C++ project knows of and reads them. But anything that needs that is a mess and the C++ world continues to multiply inherit the kludge of CFront or rather its effects on the language design and fix-by-committee. Java is too verbose and tends to have people depend on program writing tools, which is the last thing a learner needs. Pascal is old, and not going anywhere.
Remember C was derived from BCPL which was created as a teaching language. I don't hold with the theory that it is necessary to protect the beginner from pointers and mandate a managed and garbage-collected language. If you are able, after a few months, you should show him some assembler and explain the tool chain.
Compile -> Assemble -> Link -> Load (Debug), and,
Compile -> Interpret
This is how I initially got started with programming. We were required to purchase on of the TI-8X models of calculators for my high school math class. They come with a builtin BASIC language for programming. The language is simple and you can either use menus to add statements or type them. If you brother turns out to be really into programming he also can do as far as writing assembly language programs. In the more advanced models they have simplistic GUI elements for building windows, dropdowns and the like. It is a nice way to spruce up your program with little hassle. In addition to the programming language you have the benefit of access to the mathematics capabilities of the calculator. Everything from statistics, equations, This is very handy when you want to solve an equation in a program but may not be ready to write your own subroutine to do that. They have limited graphics capabilites, only grey-scale graphics and no sound. I think that as a first excursion into games and programming those items are fun but not required. Lastly I believe one of the strongest reasons to get something like this would be that it is portable. No need to bring a laptop, inverter, etc... I spent many hours in the back of my parents car typing away on my calculator. Porting games or even utilities for my math and physics classes. It was about either having fun or solving a problem that was important to me. My personal favorite is the TI-Voyage 200. It has a qwerty keyboard, larger screen and does symbolic math. Chances are if you brother is going to take a math class beyond Geometry he will probably want to have one of these anyway. Best of Luck!
I've recently been teaching my 12 year old twins how to program with Scratch from MIT.
http://scratch.mit.edu/
It's fun, there's lots of examples, and they seem to really enjoy it.
I'd start by talking about possibilities with him. Let him decide what he wants to do and get a sense of how much time he's willing to put into it. I mentored someone starting at about that age. He did VB.net for a few months, did a project using it as an OO language, and then moved to Java. But his idea of a simple project is a Swing client talking to a multithreaded server with a database behind it. He made all the decisions on project and language. That may be an unusual situation, but I'd still let the kid make as many of the decisions as possible. Let him see some examples of a few likely candidates, and talk about what he wants to do. Scratch sounds really neat if we wants to play with graphics as quickly as possible. But at 12 I probably would have found it a little bit insulting. If he wants to tinker with IT infrastructure, Java is probably a better starting point,
How competitive is the family?
My father is mechanically inclined. Always working on cars. I was never allowed to compete with him there. He does not understand programming at all, so it was a safe direction for me to explore without his interference, him always telling me I wasn't doing it right, always looking over my shoulder, criticizing, etc. When working on cars, it gets real old real fast when he laughs at you for occasionally having to think about which way to turn a nut. He never missed any opportunity to demonstrate that the old man is still The Man when it comes to cars.
My younger brother might have been a good programmer, except that he couldn't stand being 2nd fiddle to me, and maybe I made it less bearable. He went as far as getting a Commodore 64, because it wasn't an Apple II which is what I started on. But he went no further. He did not become a expert Commodore hacker, as I was an expert Apple hacker. He passed by all the sciences and engineering, and went into finance and politics. He certainly could have done some engineering or science. There were plenty we had only passing acquaintance with, things like civil engineering, astronomy, or chemistry, to say nothing of medicine. A waste, perhaps? He perceived what society valued. I am perhaps more idealistic, and think too much about what society should value. He's richer than I am. He has a wife and children, and I do not. Well of course it isn't that simple, and there are many other reasons why things turned out the way they did. But it's a factor.
So, asking which programming language is easiest could be misguided. You will tend to pick among what you know and like. Maybe the chief criteria should be what you don't know, so that you can't be an interfering know-it-all who can show him up anytime you want. If you know little of web programming, or even databases and SQL, then maybe little brother will take to it. Sounds crazy to even think of SQL? It's certainly a mess, with dozens of SQL dialects and proprietary extensions, and there is much that cannot be done in SQL.
Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
Forbid him to learn programming. You can be more specific than that - forbid him to learn Pascal or forbid him to write a program in Java that solves quadratic equations. The main thing is to forbid him to do it.
un-ALTERED reproduction and dissimination of this IMPORTANT information is ENCOURAGED
C is [for all intents and purposes] a proper subset of C++. Knowledge of C does not imply knowledge of C++ (specifically its polymorphism, templates/meta-templates, etc).
Let the kid go play outside in the real world whilst he's still a kid, instead of sitting in front of a screen making friends with pixels.
PHP and Java both have great class libraries that let you stitch together a program pretty quickly without having to re-invent the wheel or master something like CPAN (I know you people think they're easy and I agree, but it's a barrier to getting up and running quickly, and barriers are bad).
And I think learning to program for the web is a great starting place since it's easy to get results. I didn't really get into programming as a teenager because it was so hard to get impressive results with C++ quickly.
And javascript programming is great for kids. It's pretty trivial to be able to do simple animations, wire buttons, etc.
Hands down, Phrogram is the best language for teaching young people to program. It's a language purpose-built for teaching kids (it used to be called KPL or "Kids Programming Language") and it scales with the child. A young person can start by coding simple graphical applications and "graduate" to database access and even sockets programming. http://phrogram.com/
Seriously, start with HTML. It gets you instant results right away and he can see his work coming to fruition quickly in designing his own web pages. To really capture interest it can help to show the practical purposes of programming rather than making iot all so abstract. Lots of set up and initialisation just to do something can really blow out many new programmers, if there is a lot of tricky work to do simple things. HTML and javascript allow you to see results fast with little initialisation crap. Instant gratification can help capture their interest and the web page thing allows them to quickly realise the value of what they are doing. Write some HTML and publish it on myspace or on fortunecity for the world to see, tis instant payback.
Start to teach javascript and you get instant feedback. Javascript happens to be a very simple, clean, dynamic typed language perfect for a newbie. Show them how to use the javascript and debug console in firefox to debug their code. More instant gratification from making their own little web applets that can be made instantly available to world .
The real answer to your question is to not teach programming. Get them started on some abstract mathematics. It will serve them far better than learning to become the newest web flunkie on the planet.
If you must teach some kind of programming, go with a typed functional language, like Haskell or ML. Focus on these concepts, as they bring out the relation between proof and computation (every computation is a "constructive" proof):
http://web.cecs.pdx.edu/~mpj/pubs/springschool95.pdf
After all, I am strangely colored.
ColdFusion is as easy to learn as HTML, which is really saying something.
I'd say the only problems that the original poster would have would be (1) to have enough memory on the younger brother's machine to run a webserver, a J2EE server (JRun) and ColdFusion Server, and (2) making sure to run them behind a broadband router / firewall. Lotsa webserver-attacking malware out there.
The only cheaper, easier suggestion would be JavaScript, which I already advocated above. But yes indeed, ColdFusion is a great starting language that keeps getting better the more you learn it (just like JavaScript).
http://alice.org/
Specifically designed to teach tweens how to program. Essentially is Java, but with instant, graphical results, which, as a few others have pointed out, is important to keep new learners interested.
My wife took a college course which used ALICE to introduce programming- if it worked for her, it will work for anyone.
Things like this have been mentioned already, but games get kids interested. If he has a PC game he likes then see what it has for tool and languages? I wasn't interested in learning anything like programming until the local news paper mentioned there were map editors for DOOM. Had it possessed a scripting language at the time, I probably would have learned that in a hurry.
My brother's time running a private WoW server with his friends had him starting to learn MySQL. If a game can inspire a kid to try SQL surely it can inspire interest in something less fantastically boring!
If he likes FPS games, he might like to learn to build a map and script some invasion maps or neat effects. If like likes RTS games he could make some scripted stuff for maps or AI. If he likes RPGs there are any number of scripting things he could do. These kinds of scripting languages are usually just fine for teaching the basics of programming and they make it easy to have something cool to show your friends (who probably play the same game) in a real hurry.
Other posters have a good point about letting him go with his interests. He may take to programming if he tries something like this. He may not. Programming requires you to want to think in a certain way (putting the world together in logical steps?) and most kids aren't very interested in that. Having him build something -- *anything* -- for the game he likes might spark an interest in programming.
Stop; don't do it. Your love of programming doesn't automatically make you a good teacher and layering inexperience on the ingrained patterns of behaviour between brothers will be a problem. Next assess if you want him to learn or if he wants to learn. If it's the first, consider that strike three.
Now, assuming he actually wants to learn and approached you for advice, start him with something fun like Bootstrap, http://www.bootstrapworld.org/, based on Scheme, or Scratch, http://scratch.mit.edu/Smalltalk, based on Smalltalk. He'll learn fundamentals in a well-designed language and have a community of educators and students to interact with.
.. and avoid teaching C. The only reasons why C is still around are pragramitic reasons *despite* the inadequacy, bad design, and anachronistism and general retardedness of C.
Do not teach a single language. Do not predominantly teach a language, teach the concept of programming. You do not even need a programming language for that.
Make teaching fun and provide quick successes.
How to actually do it depends on how much time you want to invest in the teaching.
At any rate, I'd go for a mix of Scala (best pragrmatic compromise between good language design, portability and library & tool support), Processing and Ocaml or similar. You could even start with Logo and then go to Processing using the turtle library of processing.
The language you select is nearly irrelevant (although I would strongly shy away from the standard imperative languages, and take serious issue that C/C++ is a good target). You do not want to teach a child a particular language, you want to teach them how to think about programming. If you think knowing C/C++ or Python, or Ruby, or Perl, or Javascript, or nearly anything else in wide use right now will be relevant in 20 years, you have not studied your history.
Get a good book on PROGRAMMING, not on a particular language. There are tons. I would personally recommend Structure and Intrepretation of Computer Programs by Abelson and Sussman (http://mitpress.mit.edu/sicp/full-text/book/book.html available at Amazon ... the first edition is fine if you don't want to pony up for the second edition). It teaches PROGRAMMING, not a particular language.
As my undergraduate advisor said, "go and pick up K&R and learn C over the weekend" -- THAT is what you want to be able to do. Teaching a particular language does not generate that kind of skill. Teaching the fundamentals does.
Put my fist through my alarm clock with its ding-dong death inside my ear. - The Blackjacks.
Python works just fine on the windows command line (after it's been installed, of course). And there are several decent non-MS text editors; personally I like jEdit, but Notepad++ is another good one. Not used Visual Studio for IronPython, but I'd be interested in hearing people's experience; it's damn good for C# (not that I'd recommend that as a first language).
PUt a free copy of gamemaker on his pc. He can create a simple game with drag and drop; add a few lines of code to make it better. Eventually he can write whole games in nothing but code.
It doesn't matter that it's not based on a standard programming language. What matters is that he can see instant results, and program stuff that he likes. Learning any particular language's syntax is irrelevant, all that matters at this point is getting him to understand concepts without losing interest.
The really awesome book on JavaScript is by Doug Crockford but it's hardly something You unleash upon a non-programmer. Heck. JavaScript (the real functional language) is not something You unleash upon anyone who hasn't understood functional programming( LISP, Scheme, Haskell etc).
TCAP-Abort
Really it depends what he wants to do - if he's interested in programming for the web, for instance, then something like PHP might be a better choice, or if he wants to write games for Windows and the XBox 360, maybe C# and XNA. But in general I think Python is your best bet. It's pretty easy to get your head round, the syntax is nice and clear, it can do pretty much anything he's likely to want, although it may not be the fastest language around. It's easy to get into game programming using PyGame, or GUI programming using Tkinter, wxPython or another GUI toolkit, or web development using Django. However, I will also suggest something slightly off the wall. You might want to check out MikeOS (http://mikeos.berlios.de/), which is a simple x86 operating system written in assembly. It now incorporates a simple BASIC interpreter, and can boot from a floppy drive, USB key or CD-R so it could easily be used alongside Windows, or can be run in a virtual machine if you'd prefer. Applications can be written in BASIC or assembly. Because MikeOS is so simple, writing programs for it should be similarly simple, and the experience is not entirely dissimilar to on old 8-bit computers.
I've taught programming, part time in an elementary setting, for years, and have been a real live stay at home dad for almost 20 years. I know code and kids. Kids learn people first, things later. So teach what *you* are passionate about. A kid will spot bullshit a mile away. You can trust that your little brother knows you better than you would like. Your little brother isn't going to be learning programming, he will be learning what you like. It's the "what you like" part that is most important.
Don't worry about what language to use, all languages suck about the same amount, just in different ways. C is fine, kids have a wonderful ability with language, any language. Any kid under 14 (puberty is the dividing line) or so will pick up the syntax of any language in a few weeks. Arbitrary and weird is fine, they just go with it. In my experience kids can learn either top down or bottom up, but they have a more or less fixed attention span. You have something like 20 - 40 minutes before he will start to get antsy. (YMMV) Regular times for set amounts of time work best. He knows that Monday at 6 big brother will give him a lesson and answer that question that has been bugging him for days, or years or centuries, they're all about the same. If in 6 months he would rather find something else to do, then consider dropping it. But remember!! The discipline in a 12 year olds life is external, not internal! That really doesn't start kicking in until HIgh School.
One thing that will kill this is forgetting that he is 12, below a certain but unknown age kids just can't get certain things. You just don't know what, exactly. Just because you got it at 12 doesn't mean he will. He may get different things. Then they just go to sleep and wake up and suddenly get it. They will often deny that they ever didn't get it, it is now natural and part of them. It's magic and frustrating as hell.
Here is a curriculum used in schools to get middle school kids learn about computer science/computational thinking through game design: http://scalablegamedesign.cs.colorado.edu/ start with simple games like Frogger and make it all the way to sophisticated ones like The Sims
Don't ask /. Ask him. What does he want to do. Does he has already looked at him and let him know that you are willing to help.
Most likely he will try to figure it out himself.
Don't fight for your country, if your country does not fight for you.
Buy him an IBM PC XT, load up MS DOS 2 or so (I think it still came with MASM back then), give him a copy of colossal cave adventure, trek, and lots of soda. Eventually thrown in some BASICA and a few programs he can read the source from by doing Ctrl-C. When he burns in sunlight and/or has a body mass index of 30+, buy him a C compiler (preferably Borland Turbo C). Then confuse him by throwing both the Windows GUI, MFC AND OOP at him at the same time.
If he makes it to 20+ without a heart attack, you'll have a coder on your hands.
Seven puppies were harmed during the making of this post.
I learned with old Apple II+ Basic.
It had a crucial fun aspect in that it could control the coloured graphics and the speaker tones.
But more importantly, the goto statements made it sort of clear the step by step sequential
evaluation that the computer was doing of your language statements. Without that mental model
of the program counter going over the statements, it's all going to remain "magic".
After those initial clumsy Basic programs, I added two different things, and I think both are
essential.
1. I went downwards, and studied how the assembly language and machine language
and memory bytes/words etc.
worked (and kind of how they related to the high-level basic statements and variables etc.
And most importantly, in writing an assembler program, I came up with assembly code
"templates" that would do a standard "if then else" or another template for a standard while loop
etc. Learning the representation of one of these levels of organization in the other was
fundamental to a solid complete grasp of what was going on and what would be possible or
advisable.
2. I went upwards, realizing that the undisciplined use of gotos in the basic would be bad, as
programs got bigger, so I should create standard if then else constructs (copy-paste templates again)
and use of gosub statements to reduce the size and complexity of each block of code etc. So
I taught myself the "why"s of structured programming from first principles and painful frustration
with long complex unstructured "goto" basic programs.
Eventually in University, we went all the way down to transistors as logic gates, and TTL NAND/NOR gates, and building up to
structured programs based on combining those together.
And we went all the way up to LISP and Prolog, and modules with interfaces, and the beginnings of O-O.
I would recommend a similar bottom up approach for someone to full appreciate what they are working with, and
what its fundamental limitations and quality dimensions might be.
Where are we going and why are we in a handbasket?
Lots and lots of comments about syntax (C's sparseness, Python's white space, VBA's readability), but not many about data. If he likes programming, he's very quickly going to be managing collections of data. My short list of mandatory data aggregates would be lists and associative arrays, with various ways of pulling things out of the lists. Lists of lists in some form. All garbage collected. In my experience of trying to explain things to non-programmers, lists and some form of tag-value pairs are the easiest things to get across, especially if there's some syntactic sugar.
For further down the road, blocks of generated executable code as first-class objects are mandatory. Which leaves out many compiled languages. But I admit that this makes me at least a little odd.
"Don't use Windoze or any M$ tools unless you have to, though they look simple, they bring endless unnecessary complexity all caused by M$ trying to screw its customers"
You're complaining about complexity and suggesting Emacs and Eclipse as alternatives?
Try Scratch.
Scratch (http://scratch.mit.edu) and Alice (http://www.alice.org) are probably your best bets. I've been teaching kids at this age level for the past four years, and the children have responded best to Scratch.
Both of these have the advantage of not frustrating students with syntax. Scratch has a better community built around it than Alice does, but it doesn't support things like procedures out of the box (it's event script driven). If you want to start teaching procedures, you should look into the BYOB fork of Scratch.
Alice has a better OOP model, but it's not entirely OOP.
If I was to teach beginning programming to a child or someone who does not know if they want to commit to the field, I would teach programming in Flash.
While the Flash IDE's debugging and scripting area is not suited for an experienced programmer, it does a great job of letting someone quickly wire up visual elements for that instant feedback & gratification. Core programming concepts such as variables, loops, and functions are quick to learn. For those who want to continue AS3 has a long road of concepts going into bit fields, OO, shaders, etc...
There is a tremendous amount of books on programming in Flash / Actionscript 3; as well as great web sources in the forms of blogs and communities such as:
http://www.kirupa.com/forum/forumdisplay.php?f=6
http://wonderfl.net/
http://www.gskinner.com/blog/
This is coming from someone who has created and taught curriculum in Turbo Pascal and Turbo C++ back in the 90's for 11-15 year olds, and these days I am an adjunct professor teaching Flash & Actionscript3 to artists (non-programmers).
I'm going to be the heathen here and outright suggest Visual Basic. Even if it's far from the best coding language and it has it's quirks, you get to SEE and INTERACT with what you make. It's not a bunch of gibberish on the screen and that's something a lot of people need to learn in the beginning.
A lot of you need to keep in mind that people who like to code are a very select group. You have to be interested in things you can't actually touch and that require mind numbing amounts of logical work. That isn't something a whole lot of people can handle. A language that is easy to code in by a coders standards still doesn't mean it's good for a beginner. More then likely the OP brother will have no interest in coding at all.
Wasn't a traitor, more like a prisoner of the Macro + KLUDGE culture that was AT&T then, and a lot of Not Invented Here!
... those interested should read the C. Strachey paper on CPL and note type general, and its semantic implications, but yes this is 30 years old.
On sabatical at Cambridge (England) Bjarne found out about Simula, and thought bringing Classes into C would be neat. Not the first to make this mistake he decided to compile his new C++ into C, thinking easier. Huge mistake, CFront, years of kludges, and still no advance from C, which is an excellent systems programming language, to C++ which was supposed to be THE applications language. Still no strings, a death march of implementation, burial by conflicting committee, endless mindless complexity eg sematics of constructors/destructors, hopeless reliance on strict typing (also a Java problem)
C++ says much about the short-termism of the USA. It really is much easier to do it right the first time.
When I was 12, I actually started teaching myself programming with TI-BASIC on a school-supplied graphing calculator. HTML and GW-BASIC quickly followed, then it was on to Visual Basic and C++. If I were to do it again today, though, I'd probably start with Python—it's easy to learn and can do great stuff. I would certainly steer clear of things like Alice and HTML, which don't really teach the fundamentals of programming very well.
In a word, the big determining factors for your brother's path are "Curiosity", "Desire" and "Time". If he's got all three, he can start out with pretty much any language as long as he's got a tutorial or book that's simple enough for him to read, a simple development environment or testbed. Having some sort of project or goal in mind helps out, too. I was about 10 or 11 when I started out with Apple BASIC then I took on 6502 Assembly language (a must for any aspiring protection-cracking software pirate back then) and eventually took QBasic and Pascal once it was available in school. Most of my friends that had an interest in programming took a similar path except they started out with C64 BASIC or whatever came with their computer. As far as what languages to start with, I've seen some fun introductions to Python. With all sincerity, if your brother doesn't have at least two of those three factors working for him -- particularly the desire to learn -- then you'll probably be wasting your time. If your brother doesn't have the desire, you won't be able to teach him how to program a microwave oven.
Max Nomad . Bohemian Griot Publishing, LLC . http://www.bgpublishing.com
I have talked about the "programmer's learning path" a lot, and considering my own experiences, I am quite convinced that there is no such thing as a "continuum" towards C or C++... C is minimal and dull and a lot of work for a beginner to get anything done in, C++ is hairy and complex (even from my experienced programmer's perspective) and rigid.
Personally I have started to view programming more and more simply in terms of "formulating problem solutions in a Turing-complete symbolic system". As such, the machine-specifics have receded more and more into the background... I tend to see C for example in terms of a small set of imperative, structured-programming statements instead of "low-level programming"... the machine is just simply not important as long as the specification of the language is correct. What truly has been the most instructive thing for me ever as a programmer was learning Lisp -- I'm mostly a fanatical Lisper these days whenever I can. Of course, C's imperative statements are trivially included as a part of Lisp. It's nothing to write home about.
Python is a nice language because it contains a lot of important high-level programming ideas in a language that is easy to use... that is, it does not even waste an experienced programmer's time. Managing your memory does not make you more of a man... understanding how programming conceptually works is far more crucial.
I want to play Free Market with a drowning Libertarian.
I'd particularly recommend Ruby, even over Python. It's got very clean, elegant syntax, and its main disadvantages (performance, mostly) won't matter to him. He would be able to quickly get into web development too if he learned Rails.
I highly recommend the book Learn To Program by Chris Pine. It uses Ruby as a teaching language.
Ruby is truly purely object-oriented (no primitives) which helps with consistency and the principle of least surprise. It also does NOT have the whitespace-as-syntax 'issue' of Python. But, python is also a good choice. Ruby has nice functional aspects as well, which if he eventually learns how to use them, will make him a better programmer in any language.
Lua is used as the scripting engine for a lot of games, which might make it a good choice.
Scala is another alternative, though it might be a little tricky as a first language.
The advantages of higher-level languages like Ruby, Python, Lua, Scala etc. are that there's less code and less boilerplate, and while they're further from the metal than C, you can get meaningful stuff done faster, which may be a good thing for a 12 year old's attention span.
I'm a PhD student in computer science at Tufts University and our department is seriously rethinking how intro CS is taught at the undergrad level, so I've put some thought into this. Note that I would NOT make the same recommendations for a 12 year old as for a college freshman, necessarily.
-- "Those who cast the votes decide nothing. Those who count the votes decide everything." -Joseph Stalin
Do they want to "learn programming", or do they want to make video games? ( Or do *you* want them to learn programming? ) If they want to make video games, have them check out Alice. They'll make a video game and learn to program as a bonus. For middle-school aged people, there is Storytelling Alice, which is pretty powerful in its own right, in terms of a teaching tool.
Computers are useless. They can only give you answers.
-- Pablo Picasso
There is absolutely nothing in C that makes for buffer overflows, in C managing your data is YOUR business.
When I write user-land code I have a very small library which provides the basic tools to write safe app code and I get 1% of the bugs I would in either C++ or java, and with dmalloc and valgrind I cam prove it. In reasonable time. If you can not write in C you can not program.
OK, "right" is an opinionated position and YMMV. However, after 48 years of being a programmer, I still find discouragingly few programmers who can design a program beyond the basic forms and business arithmetic or solve problems creatively.
Get him a copy of the "The Little Lisper" or "The Little Schemer", get him a robotics kit like the LEGO system, find him some Turtle application that works interactively on his computer, get him some sort of logic controller kit (like for home automation) and focus on the areas where he has an actual interest. In a couple of years he'll be a better programmer than you are! http://www.paulgraham.com/avg.html If you both have a common interest in something like games or graphics, working on a project together builds competence. The free Robotics kit from Microsoft is worth checking out.
BTW, it's interesting how the skills I learned trying to program logic gates (back in the "Tube" era, transitioning to transitors) are now so useful in developing nanotechnology, MEMS, and biologics. See if you can get him interested in the basics. He might even like assembly language because of the high degree of control and obvious cause-and-effect relationships. The transition from Assembly to C was very easy for me.
Good luck.
"The mind works quicker than you think!"
How about Alice (http://www.alice.org)? Form their site: "It is an 3D programming environment that makes it easy to create an animation for telling a story, playing an interactive game, or a video to share on the web. Alice is a teaching tool for introductory computing. It uses 3D graphics and a drag-and-drop interface to facilitate a more engaging, less frustrating first programming experience." From what I've seen, it is specifically targeted at kids.
- It's the fastest scripting language around.
- There's plenty of doc and examples
- It's on every computer
- It's useful right away
- It has some very interesting constructs such as closures
- The OP mentioned Basic -- even if you take those tired old cliches about JS at face value, it can't possibly be worse than Basic. No fucking way.
OO is very unlike how anyone with any sense thinks, but the concept has a useful place in the toolbox. The problem is it is much overused, and the popular coding style x.hpp x.cpp for each class, too many, ill thought out classes or class-heirarchies make for obfusticated code and require a visualizer which tended to be expensive.
... this is OO bullshit!
The test of a really bad OO design is Singleton classes, Singleton objects and, as already been mentioned above, factories
Give him a ball and tell him to fucking go play outside!
I agree with most people here, but for a different reason, I think. Any scripting language is interpreted rather than compiled. I think compilation is difficult for beginners to understand. A good interactive interpreted language gives quick results so it encourages them to "experiment." I learned with BASIC and LOGO, but I'd also recommend Python or even Applescript or shell scripting (dos or linux) - those are all "quick result" languages that allow him to see that he is controlling things happening on the screen.
Nitewing '98
Everything works...in theory.
In my experience (nephews) Programming with Dark Basic gives them an instant ROI. It's the best modern equivalent to the Sinclair Basic that I started with. OK. Basic is a bit like programming with the training wheels on, but surely that's the point! The well intentioned posts talking about syntax etc. don't really matter and you already know that yourself. Dark Basic is a simple syntax that will allow games to be written. There are sample programs for most standard game types that means he's got a jump start into making fun stuff straight away.
Game programming with Blitz Max was the way we went. There is actually a book called Game Programming for Teens that gives you some lesson structure.
BlitzMax also has a C++ SDK, so you can graduate to that at some point. But as a recovering C++ developer myself I can't understand why you'd want to do the poor kid that.
You did not say what OS you are using, so I will try from a Windows Perspective. First I really love GAMBAS http://gambas.sourceforge.net/en/main.html which is open source and free. There are also the Visual Studio Express downloads from Microsoft. If the child's interest is in creating games then there are specialized open source Games engine like moodle, and a bunch of other really weird sounding names. Until you are more specific it is really hard to go down a whole list of everything that is available, even if we restrict the list to Windows.
As many above posters have stated, when trying to get a much younger person interested in something, immediate and observable results are important.
As a result, I would recommend Turing as the introductory language. While I may be a bit biased since this is the language I learned programming on, I truly think it is an excellent first language.
It has a very simple syntax that nonetheless teaches the basics of if/else blocks, loops, decision trees, and more and because it is so simple, it is very easy to quickly get into and program text, graphics or animated environments. It also comes with its own IDE that auto-indents and performs many tasks that help a beginning programmer, so little more than the base environment is required.
While the person in question should of course move relatively quickly to a real and industry-utilized language like C/Java/etc Turing can teach the fundamentals of programming in a very easy to learn package. I can only speak for myself, but had I been introduced straightaway into C, I believe I would have encountered many more difficulties than I would have had I not learned programming fundamentals on Turing.
Just my opinion.
We use PLT Scheme in our introduction to programming class at college,it has a programing enviroment called Dr. Scheme which is free to download and use and there is a textbook online called "how to design programs" that is designed to be used with the language.
I'd love to get low-level with him, and I firmly believe that C is the best language to eventually learn
There's something more Basic than that.
"We live in a global world" - Harvey Pitt, former Securities and Exchange Commission Chairman
If he is numerical at all, a programmable pocket calculator might be an interesting place. Why do I suggest this? Because it has all the fundamentals with branching and testing with an emphasis on getting the logic right, but without all the syntax issues. Unfortunately he's a little young to have run into reasons he might need to actually use a pocket calculator.
There is also Squeak. As I recall the designers were really interested in getting kids to work with programming. So dufus named Alan Kay is involved - what the heck does HE know? But I see you're a big C advocate and Squeak and Smalltalk are about as fall away from C as is humanly possible without going to Lisp.
And, since Lisp came up, you might consider Logo whose turtle graphics module allows for some really neat complex graphics.
Even a system-wide scripting language such as AppleScript on the Mac would let him work with major software packages in a programmable method.
But, really, it's up to you to work with him. I have to think working together would be great for both of you -- any one-on-one time with your kids, showing your passion for your vocation, has to be a good thing IF you're patient, trusting, and can be playful.
Check this out -
Based around LUA, and its got a full online tutorial. He could be making simple games within a few days.
http://love2d.org/
Very neat stuff.
Oh yes, obviously EMACs and vi are so much easier and less complex than the *free* Visual Studio Express you can get on Windows.
Comment of the year
-- Dijkstra
And buy him/her a robot.
Come on, seriously,
If it's not fun, he won't care. He won't give two sh1ts about libraries, OOP programming, garbage collection, etc etc etc....
If you feed him freak'in c++, he'll hate it, and he'll hate it FOREVER.
It's not about the stupid language, it's about what you DO with it.
Get a fun project, in an easy language.
Make a chat program all of your own. Then he can chat all clandestine like with his friends.
Make a program to help him encrypt and decrypt his secret stash of porn. He's a teenage boy? He has one....
How about a secret file sharing app he can use to share with his friends?
Whatever.... find a fun project for a teenage boy, and do it in an easy language. If he really takes to it, he'll eventually find his way to the harder and more "serious" languages.
Sheesh
+1 for Processing.
It's the modern equivalent to all the stuff I did in BBC Basic when I was a kid. Yet it does it within a language framework that will lead naturally on to "proper" languages (Processing is very Java-like indeed)
People spend a lot of effort blathering about which programming language is best to use for teaching. But the hard part of programming is not the programming language. It's the logical thinking skills; the abstract concepts like function and algorithm and data structure and type; the reasoned approach to breaking a problem down and seeing algorithms and patterns; the ability to learn new tools such as a utility or an API and put them together usefully.
These things transcend language. Yes, you will probably use different algorithms or data structures in Python on a Linux box than in C on a microcontroller, but you will use largely the same sort of thinking skills. You will approach writing code differently in Lisp than in Java, but in both you will be combining known parts in a new structure to accomplish a task.
And it is these abstract skills -- especially the skill of abstracting, of recognizing and using patterns -- which separate those who learn to program well from those who do not. (And this is different again from being a successful professional programmer, which entails a quite different set of skills.)
Perl is a very good language to learn as a beginner. You don't have to go into all the cool uber geek tricks to make it do incredible amounts of work. The syntax is easy to learn for simple programs.
And I might be a bit biased here, but why not dish out a dose of BASIC on an emulator? While BASIC 2.0 on a C64 doesn't provide good graphics and audio controls, BASIC 7.0 on a C128 does. Very importantly is that this could give some pretty instant gratification to a kid who might be interested in writing a game. The VICE emulator provides C128 emulation that would be good for this.
Having learned to program largely on my own at age 10 (on a Sinclair Spectrum with 64k ram and a ROM-based BASIC interpreter), I might offer a few points. They need or need not apply. When I started, computers were few and far between. I can't imagine that he would be at the level where I started - surely he's at least picked up an Internet browser and knows about the Internet, instant messaging and the like.
1. The starting environment should be something simple and clean. It shouldn't get in the way of whatever it is you're trying to accomplish. Unless the kid actually wants to become a Linux hacker (and I mean this specifically), start with whatever he's familiar with. A console-based environment is fine, since he'll need to know about basic file management very early. But don't start off with shell scripting. It's not gonna hold his interest.
2. Pick something that gets results soon. One of my proudest accomplishments in that day just let you control an 'X' character on the screen in a 'text' video mode (back when the paradigm was QAOP nod WASD). It might seem trivial, but you actually need to know a lot of basic concepts to pull it off: processing user input (hence IF statements), variables (to store your position), and dealing with the screen. In fact, I remember an 'epiphany' I had when I realized that the statement "LET x = x + 1" is a valid and important device, and not mathematical nonsense. Unfortunately, we live in the age of intricate console games with HD graphics, so doing something like that would not get the same kick today.
3. If possible, find a 'project' that's easy to start off with, but can be readily extended - another important aspect of programming. Take the above example. Once you have that, you can add target objects on the screen to be picked up - and start keeping score. You can think about how to extend it to two players. You can add walls that you can't cross, or teleporters, or other ways to modify the available paths. Later on, you can add a monster chasing you - say making one move every time you make one, and think about how to make the monster smarter, especially once walls set in. At its most basic, this is the stuff games are made of.
4. One can learn by example. I used to have books that consisted of collections of short programs (10-30 lines of code) that solved various simple problems. Eventually, he can learn to incorporate those into his own programs as they get more complex.
5. Interacting with the OS, networking, and even basic memory management like malloc are advanced topics IMO, and should be glanced over at first. I would have also included Web technologies in this, but I'd expect a 12yo to know his way around the Internet. Still, I wouldn't start with HTML (unless you want to teach him scripting instead of programming). I don't know Javascript well enough to comment, but I'd start with a more standard programming language. In retrospect, I might be inclined to start with a language that requires variables to be declared, because it helps to organize your thinking at the start.
6. Even though one no longer needs to solve IRQ conflicts, knowledge of PC hardware is still important - not to mention useful since pretty soon one can make money with it working for a local shop or freelance. Eventually, one can touch on that too. The basics of PC hardware haven't changed that much over the years, beyond the shape of our expansion slots.
7. Really, the most important thing is to get his attention at first. If he's a bright kid, has a natural curiosity about things, and has an aptitude for logical problems, you just need to get him started and let nature take it course. However, if he's more interested in sports or chasing girls, there may not be much you can do. Not everyone needs to grow up a programmer, after all.
YODA: He is too old. Yes, too old to begin the training
if you've got a mac - a great place to start is FutureBasic* - it allows you to get into programming pretty easily - get your teeth wet with the basic you know and love -- and then easily lets you get all the way to C++ and the full XCode IDE -- it supports proper recursive functions, local & global variables, and a very nice integrated IDE that ties in to XCode -- allowing inline C++ and assembly language code..
FutureBasic 4.4.3:
http://www.stazsoftware.com/futurebasic/index.php
lets you get into programming pretty quickly, without spending a lot of overhead time with an undue amount of UI handling & string handling code.
Every time I read something like this I want to puke: People like this dont realise how much work it is to even install such a way-from-the-beaten-track system, and support it.
Teaching people such stuff is a huge dis-service. Further we are talking about initial languages, which should, almost by definition, be mainstream.
Academic axe grinders should keep their experimental ideas for further study.
I agree with you fully, however... DHTML (specifically, using JavaScript to make HTML dynamic) is a pretty fun and "instant gratification" sort of programming. You're using a real language that is in wide use today (albeit not one with particularly clean syntax or exceptionally large libraries), and something like a number-guessing game can be written in like 15 lines of code (plus some HTML to wrap it up).
That said, if you want to get into *programming* right off, starting with Visual Basic.NET is a decent enough pick. It's less bad-habit-inducing than previous flavors of BASIC, and a good IDE (such as Visual Basic Express Edition, which is free) will help you learn the libraries and even the syntax quite well. It's also very easy to write a simple GUI in it, and you can either go with procedural-style code or jump right into full OOP (one of the biggest advantages of VB.NET is that it is a "real* OOP language, with inheritance and generics and everything).
For bonus points, once you're familiar with core programming concepts and the standard .NET libraries, transitioning to C# is pretty easy - new syntax and slightly more complex structure but also more powerful, and it uses the same libraries. From there, moving to C/C++ isn't very difficult either. Each step changes as little as possible.
There's no place I could be, since I've found Serenity...
Followup to my last post: another suggestion in asm-type space (if you don't want to start with electronics) is to download a corewars emulator (or perhaps a similar Robowars type game) and beat each other up in core/logic space for a while. I remember a real "aha" when I learned about Imps, Dwarves, and self-modifying code in general that way.
i learned to program on basic on an old TI, I know this doesn't lead well into C, But it gets them started with something they will use heavily in their high school years
Component Pascal is a successor of Pascal which follows the evolutionary line:
Pascal=>Modula=>Oberon=>Component Pascal
Niklaus Wirth has spent his life designing clean succinct syntax and semantic systems.
If one wishes to truly understand computer programming without unnecessary baggage then
I would strongly recommend the BlackBox/Component Pascal development environment to a new student.
see
http://www.oberon.ch/blackbox.html
Scroll down to Free Download.
The total development environment is about 10MB
and comes with complete documentation and examples.
Enjoy
Greenfoot: http://www.greenfoot.org/about/ The thing is, most people are not "meant" to be programming. That is really a weird thing, really. Life is for taking showers and stuff. So, that's why I recommend Greenfoot; first see if someone is even interested. See more at: http://en.wikipedia.org/wiki/Educational_programming_language
When I was 12, I taught myself AppleScript from this Wrox book: Beginning AppleScript .
This is a great language because it's so much like English. You can guess a command and get it right.
Also, that was a good book because it teaches you something and then lets you test and explore it using examples. And the book is still a great referecne.
AppleScrpt is a good, easy way to become familiar with programming concepts. And it's got built-in tools for user interface work, so that part is easy.
Also, there's a lot of good help on the Web for AppleScript.
Good luck! -Nathan
Logically, they are. There are no abstraction layers between what you want to do and how you do it -- you have to specify every step of the way, and thus understand every step of the way. Visual [Anything] may SEEM like it's easier and less complex, but in reality it's far more complex, it just hides the complexity from the user, who (generally) has no idea what goes on behind the scene.
But anyhow, I think the whole article takes the wrong approach. You can't teach someone to program. They can learn it, but not by you instructing them and limiting their choices. Make the options available, and let the kid find his own ways. If he can't, he was never cut out for programming in the first place.
When I was 12, all I wanted to do was cool 2D animated stuffs.
Doing cool animation isn't that much dependant to a specific language, as much as the *libraries* available to that language.
Old-time BASIC had such functions (although they varied hugely across dialects. From complete graphic libraries with lots of primitives, down to do-it-your-self-with-pokes)
Most modern language, such as Python, Perl, Java, etc... have also such library (And SDL is a popular one, and unlike older stuff, it has the adventage of being available in most modern language and on tons of platfroms, from computers to consoles).
"Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
google kid basic. its neat.
My advice, and take it as you will; if you want to "get low level with him" by using a programming language, forget it. Low level programming is something you need to understand completely in order to enjoy. I would start off with a simple and straight forward language. My personal choice would be Ruby, for it's clear syntax, and powerful features, but obviously this may not be everyone's cup of tea. Python or Java may be a good alternative. I would not suggest Perl as your first language, since it tries to cater to too many programming styles, and would be really confusing for a beginner. Whichever language you choose, use it to teach him programming fundamentals; specifically how to construct a logical framework that will solve a given problem. Do not get too deep into implementation: he is not likely to be ready to hear about memory management at this point. If you want to get creative, you can get him used to different paradigms, such functional programming with Lisp. Of course, this may be of limited use, depending on what he expects to do with these skills.
After that, if you, and he, truly have your minds set on low level languages, then I would start a bit lower with digital circuit design, with the basics of logic gates and memory. After that, at least cover the very basic CPU design. It should not be too hard to explain the basic RISC pipeline. In this stage it is critical not to delve into details, because while the concepts themselves are straightforward, covering all the formulas, special cases, rules, and caveats is enough to fill a four year engineering program. From then you can touch on assembler, and only after that would he actually be able to get the full benefit of knowing and understanding a low level language. If he does have a talent for it, then I strongly recommend the former method to get him familiar with the basic ideas, then the latter method to teach him how those basic ideas tie into existing systems.
Further, if you do try something like that, I would take a day at the start to go over how it all will tie together in the end. Maybe even make a diagram. This will save you a lot of headaches in the future, since you will be able to redirect all the "Why are we doing this again?" questions.
If he has the patience for it, this sort of knowledge would give him an invaluable step up on his classmates, so I do agree that it would be time well spent.
I haven't used it myself, but you might want to take a look at the Revolution programming language which has english-like syntax and seems to be more capable than Logo/BASIC as a beginner's language: http://developers.slashdot.org/story/09/11/26/2016255/Dumbing-Down-Programming . I hear it is being used in an academic setting to teach programming to Lit/Art majors.
"Proggraming is like having sex, son. Make just one mistake and you'll have to provide support for a lifetime."
Have gnu, will travel.
I recommend Scratch (MIT), Alice (Carnegie Mellon) and Python, for teaching kids. I have some video lessons here: http://young-programmers.blogspot.com/ on those three, plus Jython and Pygame, Scala and Lift.
Carter Sande, young coauthor of Hello World, did a guest video lesson on the Young Programmers Podcast: http://young-programmers.blogspot.com/2009/11/carter-sande-presents-pythoncard.html
Ahh the TI calculators were great. I remember it taking hours and hours to plot out a mandelbrot set. Of course I don't think my code was very optimized, and the main image was pretty blocky. But that was way better than paying attention in class!
But for learning C style languages playing muds in college was a fun step. You could go from the basics of functions to the advanced with lambda closures. Shame that people all want graphics so the days of the text muds are decades past. Although a friend's son started only a few years back at 12 and picked things up pretty quickly. Of course you need a test mud for the kiddies since ever kid wants to build a lightsaber right away but it's a start...
Have a look at BlueJ http://www.bluej.org/ I think that java is a great language to learn programming and being based on C-style syntax, the transitions to C should be fairly smooth.
RTFM is not a radio station.
You should get a hint about this by reading the myriad of replies to this topic (I have counted at least 10 different suggested languages, which tell you all what you need to know: the chosen language is frankly immaterial to the objective).
I would suggest that you use a language you are familiar with, you are bound to teach somebody better if you understand the tool used fully.
IANAL but write like a drunk one.
To start at the beginning (flashlights and morse code, switches, relays, telegraphs, and, or circuits, ... modern computers, check out “Code,” by Charles Petzold.
Honestly, I have a six year old -- he's already learned the basics of VIM -- and he actually calls it his favorite "game." He presses "i" or "a" and types away & giggles as his daddy pronounces his silly made-up words. He knows to hit ESC and dd to start over again (IOW, he gets modality)... Kids are adaptable & can grasp more than we give them credit for.
Usind an IDE is more complex than just usind a text editor and a command line. You write the code into a file and then tell python to execute that file. Two separate and very clean actions. All those IDEs and Expresses and Eclipses only get in the way of actual programming.
A simple gedit will work just fine on Linux, then you can move on to Geany. Don't know what reasonable text editor to recommend on Windows as I have not used it (except for gaming) for like 8 years now.
Do you know how stupid and childish you look when you say things like 'Windoze' and 'M$'? All that does it let people know that they should ignore whatever else you're saying. And why exactly does a 12 year old care about "an OS and full tool chain"?
If you want to teach a kid programming, the lessons shouldn't start anywhere near a computer at all. Start with visual problem-solving "toys" like LEGO, Tinketoy, ErectorSet, ConneX, and the like. This will be an opportunity to observe and find out whether the kid takes well to the activity or even has a mind well suited to it (I have known people who simply cannot program no matter how hard they try). If the kid isn't well suited for it or doesn't like it, then you can move along to something else; if the kid is a natural or takes a real shine to it, give them a few years' time with that to build up a suitable problem-solving framework upstairs, and THEN introduce them to computers and programming. At that point I would suggest a strongly typed and structured language, like Pascal/Delphi.
Linden Scripting would be fun for the kid and it follows good programming syntax. Visuals? Not bad in Second Life. Just keep him out of the Adult Areas, or he won't do any programming ;)
Bitcoin pyramid: Join here: http://www.bitcoinpyramid.com/r/1427 it's FREE!
Poll a few hundred English lit professors about which one novel you should start with to get a kid into the classics and you are going to get a few hundred very different and extremely opinionated answers. Put them all in the same room, and you'll get a lot of interesting arguments about it too.
My opinion? I've taught kids aged about 8-17 programming languages at summer computer camps for over 10 years, and I have otherwise been an educator for a while. Despite my own preferences and opinions, the truth is that unless you try to start someone out on INTERCAL, language doesn't matter. It's not like Bobby would have become a phenomenal programmer, except you erroneously chose Language X to start him off with, and he hated it, so he became a hair stylist instead.
If someone doesn't do well at all with C++, while BASIC for example might be less scary, in my experience it makes no difference to reapproach programming with the different language. At least as far as making a difference between having a real interest/performance, and the distinct lack thereof. If someone is going to "get" programming, they'll be able to get it with any common programming language. Period.
Furthermore, a kid's understanding of a programming language is going to depend much more on the quality of the tutoring/teaching/etc. methodologies, but that's another topic for another time.
I started learning basic between age 6 and 7 for the purpose of writing my own games, and then learned C from K&R around age 12.
I don't feel like the language is nearly as important as why she'll remain interested. First, you must provide a role model by visibly playing by writing programs yourself. Second, you need a medium of action which the kid will appreciate. A few possible medium are (1) lego mindstorm, (2) X10 home automation devices, and (3) video games.
I think the language will often then be determined by your own entertainment interests.
p.s. A major threat here is the potential distraction from more passive entertainment like better video games and television. If you play flash games, then start writing them. If you play WoW yourself, then write Lua script addons, and teach her how to write them too. If you play counterstrike, then learn how to program bots, and play games involving bots. etc. I'd seriously consider selling your wii, playstation, xbox, etc. and also avoiding the television.
The Christian religion has been and still is the principal enemy of moral progress in the world. -- Bertrand Russell
Recent versions of NetBeans do very well with Python. Eclipse with Pycon isn’t bad. Not sure why you think Python is too big and complicated. Seems ideal to me.
Good thing you didn't post your location -- a clear case of child abuse if ever there was one!
Now my first child could tear down a machine and do a full reinstall of Windows 95 before he reached the age of 9 -- and the skill supported him all the way through both high school and college.
No. Well...maybe. Actually, yes. It really just depends.
Okay, maybe I use it too much to see it, but what's complicated about Emacs? There are like a half dozen things to learn, then you can navigate through the entire thing and do just about anything.
In comparison, Visual Studio is a never-ending maze of menus, toolbars, and dialog boxes.
Maybe not
What about a basic lanugage?
You have Liberty Basic which is fairly cheap and pretty close to the Apple basic days. You could FreeBasic which is free, you would just have to setup one the free IDE's. Also Emeregnce Basic which is shutting down in a week or so is cheep and you get the source code for a $100. The first and last have decent interfaces and will support some fairly advanced programs.
Emeregnce Basic Bundle:
http://www.ionicwind.com/forums/index.php?topic=3823.0
You say things that offend me and I can deal with it. Can you?
That's a *much* better way to start them off. It's equivalent to BASIC on an Apple II really, but even more fun.
Then you can start them off on something like a Facebook App, and then web pages with Perl/Javascript/HTML.
"You have the option of insanity. I do not. And that makes me crazy!" - Brian to Angela, My So-Called Life
Why the Lucky Stiff created an online Ruby environment for teaching programmign to kids. It's called Hackety Hack. Here's a link:
http://hacketyhack.heroku.com/
Teach him something fun like Hornetseye.
Its like VB, but for images.
I told my 12 year old that if he helped me make a Hornetseye app for a QUIZ, I would take him to Legoland.
We had a great trip!
Here is what we built
-jim
Get paid to drive around, maybe
I hate the fact that there is SO much intermediation between the keyboard and the actual machine in our current computing environment (when it comes to teaching the fundamentals of computer programming). I doubt that our programming models will ever actually return to the intimate connection to hardware of the 80s, which is fine, but when it comes to teaching the fundamentals of the interaction between the instructions and the actual machine / chips there is a lot less between you and the machine when developing in an 8-bit world. A single wrong character can bring the whole system to a halt, or cause really unexpected behaviours that are often not seen in our compiled / checked / verified modern programming environments. There is also a lot less help from the system in developing, so if you do take to it, it is because you enjoy the challenge despite the obsticles and clear limitations of 20-year-old hardware.
I've built up a 'lab' with old Atari, and Commodore 8-bit machines. My son is learning Atari and Commodore Basic and Atari LOGO. For Christmas he wrote a Christmas greeting in Atari LOGO, which really required him to dig in to recursion and integrating the application's behaviour in to an internal mental model, so I'd call this approach a success.
I find it interesting to see the comments on PYGAME here...I'll have to investigate as eventually I'll want him to move to the next level where he is using 'modern' languages once he groks the basics and wants to do something that he can share with his peers via email.
I think a lot of you are seriously missing the point when you're suggesting c/c++/asm, or even c#/VB.NET/Delphi as suitable languages. The idea is not to start them on the shortest path to them to become the perfect programmer with impeccable knowledge of the machine and computer science principles, but rather to spark a passion in them for programming that they will continue of thier own volition. Let them get interested first, then they can learn to program properly later. .NET etc have huge base class libraries full of useful stuff but its way to overwhelming when starting off) or the tools/ides themselves are too complicated (try explaining the ins and outs of eclipse or visual studio to a kid).
The problem with using low level languages, or widely used commercial languages is that the languages are too complicated, the libraries are too big (Java,
Thinking back to when I learned to program in QBasic I think the ideal language is one that is simple to make stuff happen on screen (Most kids start programming so that they can make games, so you need something which gives them the impression, at least initially that graphics and interactivity is an achievable goal),is fairly limited in its base libraries (this forces you to learn to solve common comp sci problems, or at least think about solutions to them as the libraries won't do it all for you), and has a slow execution environment (this forces you to think of better ways to do things and work within the constraints of the language).
My suggestion is javascript/HTML, the IDE is the most familiar app to most computer users - the browser, you don't need any dev tools, its totally cross platform, you have access to a powerful and pretty easy to understand display engine with html/css and you can write anything from a picture gallery to a text adventure, to a mario clone depending on your skill level.
Programming is a tool. Find out WHAT he wants to make and choose the language (and libraries) that would be best to achieve that. The quicker he can get some gratification and see any spec of what he wants to make come up on the screen the quicker he will want to do more. Once he starts getting into it THEN start getting into the "why" and "how". The key to teaching anyone anything is to 1. Show them the value of the skill. 2. Show them the gratification of using and achieving something with that skill.
As for a "beginner" language, languages that are made just to teach concepts and have limited practicality should be avoided in my opinion. If he can handle learning to program he can handle learning to program in C. Don't discount straight up Assembler either, not on the PC but rather for embedded applications like MicroControllers. Getting an LED to flash on a board is pretty easy and can be done inexpensively and simply if you have the right tools (look into AVR or H8, you can be up and running in under 100USD/10,000JPY). Say he wants to do 3D game programming or simulation; more than the language is the technology - straight OpenGL lets you do things like transformations, rotations, etc. without having to know how to build a matrix or what an affine transformation is, yet if you get more and more into it you can do your own matrixes as you please and introduce things like shaders etc. Libraries like (Free)GLUT will get you up and running demos in no time and samples are plentiful, and once you want more SFML will get you up and building full applications with no nonsense. In Java there is JOGL as well, but getting canvases set up and contexts and blah blah blah is something you may want to do for him at first if you choose JOGL as the underlying concepts are a bit too deep for a beginner.
I've been fortunate enough to mentor a couple of prodigies. The key is not to Go Big, or Go Small, or Go Bare Metal, it is to go where their interest lies. If they really want to know about electron migration through a solid state material, Hell, go for it. But if they are interested in how to generate a web page, that's where you start.
If they get hooked and you start to work together on really interesting problems, you will eventually get into all of the classic core problems of program development: design, platform choice, networking, deployment, security -- you'll get to all of these eventually.
My vote for a first language is Python. I also suggest starting with Guido van Robot as an interesting starting point. Even older kids will understand that this is just a starting point and they may zip through the problems in a matter of days or even hours. You will encounter limitations in terms of functions, looping, etc., but that can be a springboard to how you do it in real Python.
For Windows I found the Aptana environment (Eclipse + PyDev plugin) to be easy for kids to understand.
C#, Pascal, Javascript??? Sure, and while we're at it why not give him an ADA compiler and the DoD style guide.
Logo was designed and built to teach programming concepts to kids, and excels at it. Has done for 20 years.
I've got a CNC 3-Axis milling machine at home that I don't use much, but we still gave my 6-year old nephew LEGO for Christmas. Think about it.
Jeremy Lee | Orinoco
I'd suggest Logo, but the poster said he wanted a language to lead into C/C++, and Logo will lead into a good language instead. :-)
i'd hit it so hard, if you pulled me out you'd be the king of britain [bash.org]
Then jump asm (to learn to address the metal) to Basic/Python
Woah, skipping a few steps, are we? I hope he built an ALU and then a microprocessor before that!
Yeah. Would you choose a neurosurgeon who pokes around people's brains in his spare time? I wouldn't.
What is this "fun" of creative writing of which you speak, that involves no grammar or spelling? How does that work, exactly? Do you give a chimpanzee a box full of magnetic plastic letters and an iron chalkboard, and then show him that he can toss the letters onto the board and make them stick?
I'm so very sorry that having a structure to the process takes all the fun out of it for you. You can go back to your cage and swing from the branches now.
---And I'm a damn good coder today. That being said, I would suggest teaching the kid something he can do something neat in, or he'll likely lose interest. Maybe GameMaker or those robotic lego things.. Then move him into Python when he grows past those.
The key is not to Go Big, or Go Small, or Go Bare Metal, it is to go where their interest lies. If they really want to know about electron migration through a solid state material, Hell, go for it. But if they are interested in how to generate a web page, that's where you start.
I'll 2nd this and lament my lack of mod points to numerically bestow positive reinforcement upon you.
"Common sense will be the death of us all"
I've been fortunate enough to mentor a couple of prodigies. The key is not to Go Big, or Go Small, or Go Bare Metal, it is to go where their interest lies. If they really want to know about electron migration through a solid state material, Hell, go for it. But if they are interested in how to generate a web page, that's where you start.
I'd definitely agree with this.
My first programming language was AppleBASIC, which I learned around the fifth grade or so (from what I recall). I was entirely self-taught, as no one in my family new anything technology-wise. My dad was mechanically-proficient / my Mom good with numbers... but computers? Forget it. I inherited the Apple II+ after it didn't pan out as a business computer. I learned from a book with a big red cover written (apparently) for kids, and it was fantastic. I wish I could find a copy of it somewhere...
I went the high-level approach. I had no concept of low-level assembly - didn't even know it was an option, and didn't know a thing about binary numbers (it was a mystery as to why the number limitation in programmers was 65,535 :). But I don't think I missed anything by learning about that later, when I decided in programming as a career. I'm now a professional videogame programmer, so of course, my language of choice is C++ today (with C# / Python / Lua for tools development).
I've talked to some of my engineering and programmer friends... another one started in assembly language on the Commodore 64. Some of them didn't program until much later in life. Personally, I don't think I would have enjoyed assembly programming - honestly, I still don't even today. So yeah, don't try to dictate how the kid learns. Find out their interest and zero in on that.
Irony: Agile development has too much intertia to be abandoned now.
Just stumbled upon this today. Not sure how good the book is but found it linked today on http://pygame.org/
http://inventwithpython.com/
I see a lot of posters here suggesting things like Python and, god forbid, Perl & C. I think people suggesting things like that are forgetting that this is a 12 year old he is trying to interest in it, not a teenage geek already interested in it as they probably were. Your best start is probably something where they can see instant gratification in the form of something the kid might be interested in accomplishing with technology. Lego Mindstorms might be a good start, and then if they latch onto that heavily perhaps you could move them to an Arduino in a year or two. You might also consider something like this:
http://en.wikipedia.org/wiki/Scratch_(programming_language)
I'll have to go with Javascript. Along with some HTML, which isn't a language, but works with Javascript and introduces the concept of having computers follow instructions. Of course I'm by no means the first person to suggest it, but it does have some attractions for a beginner:
-- language is actually used nowadays (you'd think this is an easy criterion, but people suggesting Logo or ancient home computers because that's what they programmed on 20 years ago fail at this one)
-- no compiling needed
-- you already have something that runs it
-- results immediately obvious, does things that are immediately useful, even to a 12 year old
-- existing body of programs all over the place that you can examine for yourself (just look in a bunch of web pages and you'll eventually find something)
I would watch out, however, for trying to push programming in any language on someone who it isn't right for. Not all people can, want to, or need to, program, and I see an undercurrent of "of course he's going to program" in the original article. You can't push your little brother into programming unless he wants to.
Having first started programming in the second grade (completely self-taught), I remember first starting off with BASIC. However, since that's not really around anymore and there's no real equivalent, I'd recommend python simply because it doesn't require you to initialize variables, the indented syntax is extremely intuitive, and most of the operation are easily understandable. Start him off with simple console apps, like an adventure game, and then move into trying to imitate other apps, at which point he will almost definitely want to start pursuing more low-level languages like C. For me, I went from BASIC directly to C and then from C to python. The transition from BASIC to C was really difficult due to the many differences but it goes to show you that no matter what you start off on, you'll do fine.
Woah, skipping a few steps, are we? I hope he built an ALU and then a microprocessor before that!
You jest, but (also in answer to other replies) I was more suggesting interesting parallel tracks rather than something proscriptive - a 12-year old can get it.
If your 12-year old likes learning things by reading, a really really good resource is A.K. Dewdney's Turing Omnibus - a non-major comp-101 level text that's really REALLY good at describing everything from electrons and bare metal to theory and practical coding. Puzzle-oriented and v. accessible to pre-high school nerds.
A father molds his children and establishes an heritage. this is the meaning of being a father -- by definition. If you want to raise bastards, by all means do so by taking no interest in molding your children. Please do not discourage this father from doing his job.
That being said, the challenge in molding is to do so in accord with the child's natural inclinations -- his "bent." Many children are not naturally inclined to proficiency in programming, but all need to learn it -- and not only to understand their heritage. The talent of instructing a computer to "do things" for humans will be the most essential basic tool for a person to learn in the next century, if not the next millennium.
Consider a man of yesteryear -- what does he look like? My grandfather was a preacher -- but to make ends meet he worked on the first flying wing... he riveted. He plied his trade honorably with yeoman's work, but his labors are now replaced by robots controlled by computer.
My father wanted to be independent and own his own business -- but is a man without skill... he turned to the craft of a shoe repairman. This is a job that is now being replaced by a combination of technologies including robotic repair. This trade will also not survive another generation.
My employ is something that may last a little while, but definitely not without change. I do test engineering on wireless devices (yes, a great departure from my forebears). Most of us use tools delivered to us by our suppliers. My differentiator, is that I have learned how to program. I can manipulate the programming environment(s) that our suppliers have delivered to make our organization more efficient, and allow us to target more than one vendors' tool set -- IOW, we are defeating vendor lock-in (or are at least convincing our vendors so) to the effect that we are "comoditizing" them.
This is the future: leveraging "machines" (in the classical sense) and the languages of machines to do the work of our forebears -- and of that illusory "cheap labor" from China, et al. Perhaps... it also means to use machines to program biology to perform the next level of programming -- but in all it will be "programming of machines ." No matter then end technology, whether biologic, radiologic, philosophic, whatever -- the man that can leverage machines to do his bidding and program in any given field will be supreme in that field -- if only to reduce economics of advanced technologies to that of comoditization.
QED.
For the ti89/92+/v200 series calculators you can write C programs on a PC and compile with GCC.
http://en.wikipedia.org/wiki/Jury_nullification
Look at one of the Parallax.com basic stamp board of education kits or a BoeBot kit. The manuals that come with the kits are really well written and teach not only introduction to programming but also a bit of electronics. It's one thing to teach a kid how to write a program to move a dot on the screen but watch what happens when you teach them how to write a program to move a robot around.
I got introduced to computers december '79 on the old commodore pets. Since most stuff was in basic back then I started messing around with existing programs, and quickly learned how do stuff like edit the number of lives in the pac-man and asteroid clones we had for the machine. I messed with other programs and typed in programs from the computer magazines of the day, and eventually wrote my first complete program at 9 (an learning tic-tac-toe program), which I ended up showing off at a computer show. Found out about copyrights at the same fair when I got in trouble for printing out the source-code for someones robotron-style game because I wanted to see how it worked. After basic I learned 6502/Z80 and Pascal (nothing quite like going from 3rd grade to a college class studying pascal on teletypes and old dec terminals), and eventually played with Logo, C, Fortran, C++, Occam etc.. through out the rest of my primary school years.
Anyways my suggestion is start with existing open source programs (games or amusement type software would be great) and let your brother mess around with them for a bit. As much as C / C++ are powerful and useful an interpretative language were the results of any changes made can be seen quickly is good. Old school emulators with some basic programs, or stuff written in javascript may be good starts, or better yet if they play games that support scripted addons let them play with some of those. For example addons for World of Warcraft are written in LUA.
Getting used to programming is more important than which language, once one language is learned jumping to a new language is only a little more work, especially for similar languages. The biggest differences when switching languages are language type (procedural, object oriented, or data-flow), type strictness (loose/strict typing), memory management (garbage collected, manual or mixed), structure (structured or spagetti), parsing (compiled, or interpretive). While it's better to learn stuff like memory management, structural and object oriented programming early, it can still be learned after getting a feel for programming. At least that was true for me, my earliest programs were horrible spagetti with mixtures of basic and assembly.
I'd wait on stuff like design patterns and other meta concepts of programming, they make a lot more sense after someone has learned to program and wants to hone their craft.
Work through the included PDF document examples, it basically does what the old qbasic provided, a quick IDE / interpreter and easy access to some text functions ( for the classic 'Hello World' and then easy access to some graphical drawing functions, even includes a turtle).
http://msdn.microsoft.com/en-us/devlabs/cc950524.aspx
http://www.alice.org/
That's commonly used as a starting point. It's Java, but not as we know it.
Java is actually fairly simple to start with. Certainly a lot simpler than C/C++ to start with. As long as you don't make it do JEE then he'll be fine, and he can even do some basic graphics which gives instant gratification. Once of the nice free IDEs (NetBeans ot BlueJ, NOT Eclipse for a beginner) can help to build something that will run (with a little bit of your help). And there are plenty of jobs if he continues Java. Many universities and polytechnics/technical schools start beginners with Java and with good reason. It scales from small simple problems up to big ones and you don't have to worry too much about string/memory management to begin with.
When I was a teen I was mainly interested in Adventure Game Toolkit and before that, Player-Missile Graphics. Of course, that brings up a point, how do you get a child interested in programming? In my case, I had my own computer (well, I mostly shared it with my Dad, which occasionally led to arguing) and a supply of cool computer hobbyist magazines. So, if I were going to get a kid interested in programming, the first think I'd do is get him a cheap, linux netbook and the next thing would be a magazine subscription. Hmm, but what magazine? Well, before it got axed, I like Maximum Linux, but there seem to still be a few good Linux magazines around. Oh, someone is probably thinking, at this point, why Linux? Why not Windows? Mainly because Linux is an OS aimed at programmers and Windows is aimed at non-programmers. There are a lot of free tools for both, ymmv.
"MIT betrayed all of its basic principles."
I hope whoever is writing this sees it, but when I was growing up my parents turned me on to an oolldd program called "Klik and Play", designed for exactly this.
http://www.stevenchan.us/programming/klik
I am a self-taught programmer and I have been programming for over 12 years. I started my interest in programming when I was 12, but wouldn't consider myself into programming until I was 14.
When I was 12, I got a C++ programming book and went through it fairly quickly. My interest was in developing video games like Doom, Quake, etc. At the time I was young and lacked the knowledge or dedication to look into this any further and became attached to HTML/JavaScript, PHP and AS2/3 as a web developer and 2d/3d animator/modeler/artist.
Slightly off-topic bg info: I actually went to school for Media Arts and Animation(Where I flunked out with 1 class to graduate due to financial issues and turned to programming permanently) and while I did take a couple minor programming courses based on AS2, I found that I already knew more than the teachers at my school on the subject from reading through the docs when I was 15-18 and ended up serving as a tutor in the classes(as I did in virtually all classes with nearly straight A's and still unable to graduate from final class, almost laughable if it hadn't cost so much) even though I would now consider my knowledge of AS2 at the time to be infantile. I should have expected as much since the school was dedicated to art students, many of whom could barely work a computer.
Back to the subject: I think the best way to get a new person into programming would be to teach them the fundamentals of object oriented programming first and make sure that it is taught around something they are interested in. For example, if the noobie is interested in games I would suggest teaching them to program in UnrealScript - Unreal Engine 3 - UDK or XNA Game Studio 3.1. If he is into 2d graphics and animation try AS3 or Silverlight(I do not really have experience with Silverlight past a few documentation glimpses and tutorials). If he just likes dealing with data try PHP/MySQL.
The important thing here is to make sure that he grasps the techniques needed to produce reliable, extend-able, clean and well documented object-oriented code. If he's really interested in programming he's probably already good with math and will pick up on the algebraic and geometrical side of things easily in school math classes and be able to relate them to the object-oriented ideas you have already instilled in him allowing him to be able to generate code producing quick visual results with any of the previously suggested packages. All of the languages I have suggested are extremely well documented.
I hope I have been helpful.
The colleges around my area want you to know Java, Java, and more Java. So my vote would be JAVA!
I've found Scratch to be very accessible for kids starting around 7. http://scratch.mit.edu/
The visual programming language was used by Lego for the Mindstorm platform, as well as others. I believe there is an Arduino front end too.
Scratch TNG is a 3d version of Scratch tilted to simulation.
Alice, Storytelling alice, and Alice 3 are all nice. Alice3 has an onion-skinning mode where the visual programming language can be peeled down to the underlaying Java code in a series of discrete abstraction steps.
Unity3d, recently made free, would be another step along. A non programmer can get somethings to happen pretty easily. Underneath you are scripting in a javascript variant, python, or C.
First off, my background is pretty similar to the progression you mention: BASIC, Pascal, then C/C++ and Java. Here, then, are my general suggestions:
Based on these, I'd go with Java or C# to start. Maybe C++, but Java would be easier to learn. If you do go with Java, I'd strongly suggest he follow it up with plain-old C, just to get a feel for what life's like when you have to do your own memory management, don't have objects, don't have built-in synchronization primitives, don't have strong typing or type safety, etc. etc.
Well , i started with QBasic when i must have been about 10-11 years old.
Which was a pain at the time , because you could program , but not build your programs ( the compiler i had didn't have the option to create exe's . later ones did ) .
Then i moved on to Visual Basic 4 , than Visual Basic 6 , and eventually Visual Basic.NET ( much later )
I think i most have been 14-15 years old when i started playing around with C++ . I also looked into Java but only really started programming in it when i was studying informatics .
In hindsight , it would have been better had i started with C++ and then moved on the Java. The Basic language seems so useless to me now . Then again it was easy to create some fun graphical effects with it ( putting dots and lines in various colors on the screen , etc ... ) . But you can probably do that in C++ was well .
So i would go for C++ , though i remember the syntax ( the for in particular ) being frightfull at first . It's good for learning the basics though.
Then move onto Java or C# later.
Slipping shoelaces ?
It's a brother, not a father. I'm just picking up on the very salient lack of any comment about whether the kid WANTS to learn any of this stuff. When I was younger I tried several times to get my own brother to be interested in things I was interested in, and vice versa. Some of those discussions ended up in fist fights. Eventually I realized that my brother is who he is, and I am who I am.
My son taught himself C++ at the age of 12. He still uses it now (He's 15) and it has helped him with game coding which is what he really likes to do. there are some books available to for youngsters to start with simple tasks. Try an amazon.com search for coding or software development for kids. Hope that helps.
Maybe, if you want him to be a programmer, you should first teach him how to say: "Ya want fries wizzat?"
Excuse me, but please get off my Pennisetum Clandestinum, eh!
There are lots of great languages for starter programmers, but a lot of these languages don't have extensive lessons available for beginner programmers. If you're providing guidance or if the student is highly motivated, it's not a problem, but sometimes it's useful to have some lessons and exercises available. I created a website called Programming Basics that provides some basic but thorough tutorials for teaching JavaScript to beginner programmers.
Yeah - I taught myself Basic. Then I was told that C was the language to learn next. But the symbols scared me (I was 13 or 14), so I took the next recommendation, which was to learn Pascal.
Learning C was very exciting for me, as it seemed all arcane and mysterious. You're right that the symbols were difficult to understand, but pointers were worse. I'd ask one of the programmers at the university I hung out at (to use their PDP-11/70s and Vaxen) what a pointer WAS. Their answer was invariably something like "It's something that POINTS to something else" or "It's a variable that holds a value that points to something else."
It would have been nice if they could have said something like "You know how a variable can hold, say, an integer or a character value? Well, that variable is stored in memory. All bytes (don't confuse a kid with the concept of word-size please :-) ) have an 'address'. *draws typical picture of a memory layout* So any variable you create has an address. What if you want to know the address of that variable? In C, you can say '&variableName'; the value that you get from that is the address of the variable. If you store that value in ANOTHER variable, THAT variable is a POINTER to the 1st variable."
THAT, I would have understood, but nobody seemed to want to take the time to explain it to me.
I would recommend a traditional BASIC Interpreter with line numbers, then later Pascal. If you want to go further, Assembler and then maybe C.
It's no use trying to teach someone C without him having a firm grasp of Assembler. And Assembler is best beeing taught via traditional BASIC.
Asside from C, the worst popular language to start would probably be PHP, because you already need to know what you are doing, when writing in PHP.
As for Operating Systems, I would definitely go for Linux as it makes things like networking a _lot_ easier to learn.
If you want your brother to learn programming, tell your parents to forbid him from doing so. That ought to do the trick ^^
Yay me! ^^
30 years ago, I learned to program at 11 (in asm).
When I discovered C it was a revelation: everything I could do in asm (with the help of 1% of inline asm in C code) -without the pain for the rest of the program.
No other language is as simple (32 keywords!) not as pure as C is, not as powerful.
No wonder why ALL other programming languages are written in C...
And, if a kid is willing to learn, why go for a bloated, slow and buggy language rather than a 40-year old established open-standard?
You shouldn't look at programming strictly from a "writing code" perspective. No matter how fun or friendly a language is, if it doesn't do anything, it is not interesting. And you will not be able to persuade most people into finding code alone interesting. Maybe scheme code is "interesting."
Instead, you need to focus on the results of the code. If the student is familiar with Windows, then teach them how to build windows apps. If they love their iPhone, then maybe how to write iPhone apps. If the kid loves blogging, then maybe how to build his own web site.
Give them the tools to fulfill *their* imagination, not yours.
And it is all about the tools. If there is anything a child has, it is time. Give them the tools to make their dreams come true, and they will work on it tirelessly on their own. That is how we learn the things we remember.
Q: How to teach a 12-year-old to program?
A: It's easy. Just tell them they shouldn't do it.
Well, here's what I'd advise:
Solve a problem.
My background is that I got an Apple ][+ in 1979. I was 11. Today I'm a professional programmer, and I've worked in lots of different languages. The first things I remember doing "solved a problem":
But the point is that I didn't start with "I want to program", I started with "I'm gonna solve me a problem."
And then I started keying in programs from the BASIC Computer Games and More BASIC Computer Games books. Which is actually how I learned BASIC, because the dialect of BASIC in the books wasn't the same as Applesoft BASIC, so I had to learn how to fix it.
And I just spent a lot of time finding new programs and playing with them.
I wasn't pressured by my dad to program a computer. It was just lying around. I responded to it. If you wanted to do anything cool, you better get to typing some BASIC. So I did.
My daughter is 11 right now. She hangs out on the Neopets website. A large portion of participating in that community is doing stuff in HTML, Javascript and CSS. She makes pages in order to participate in the community, and she understands how the changes in CSS work. Some of her designs are pretty clever. She has taken HTML from other places and modified it to suit her needs. She's showing very programmer-like behaviors.
In my day, I wouldn't consider a BASIC -> Pascal progression. That's if you're going to get a CS degree. Pascal wasn't a practical operating environment on the Apple ][. Professional programming in general was done in 6502 assembler, which I learned when I started making more advanced stuff that I wanted to use personally. In my teens, I started working at a software company part-time after school, and I had to maintain 6502 code, which is where I ultimately thrived.
So anyway, solve a problem that your kid wants to solve, and let the problem dictate the tool. Much as with professional programming. Don't just hunt around looking for tools to learn at the outset. Make the learning evolve naturally from the problem.
I made Basus not long ago. Successfully tested on about 50 kids. Read about the idea behind the programming language here: http://basus.no/idea.html
Get it here: http://basus.no/
Maybe you should inform and educate yourself before you puke. These languages are as easy to install as C or C++, and it is more easy to write programs that is portable to many systems. Languages like Scala and Ocaml have been used successfully in large-scale projects and by companies who value the increased productivity and easier maintenance. But most importantly, if people would finally stop using languages that are nothing more than a macro assembler language with a terrible syntax, it will get much easier to avoid endless pathetically simple security issues and memory leaks, it would reduce the lines of code and it would make code easier to understand and modify.
The problem is people like you who cling to what they have learned and try to avoid the intellectual challenge of learning something that includes the development of the last 20 or so years in that area. With people who call themselves "programmers" because they can hack code in C, the amount of software that some day needs to get ported to some proper language just grows.
People like you are like those who did not stop using, promoting and teaching COBOL a couple of years ago. Do the world a favor and find another job. I am sure you will find an oportunity to puke there too.
I always always tell people who want programming experience to pick a language that they can do something with.
I'm assuming these things based on that he's 12 and interested in programming:
1) He's interested in computers so probably spends a lot of time on them
2) If he's spending a lot of time on them then he's likely got a favorite game or two
3) If he spends any significant time playing these games then he's likely interested in making tools/macros for these games
AHK (autohotkey) is probably one of the easiest game macro languages out there and that's beside the fact that you can use it for other stuff. My favorite feature is that it's loosely typed, so it's much easier to master initially, though debugging can be a pain because of this. The forums are very useful with a very dedicated community and the API is EXCELLENT, but there's no tutorials that I know of extensively devoted to learning to program using AHK. The most important thing I think you can note about this is that it can help him teach himself how to program, which is very important if he wants to move into other languages later. If memory serves it's also coded and extendable in C, so there's a natural extension into "real world" languages there.
So there's good things and bad things about using AHK, but it's the one I pick for people looking to learn the basics of programming.
I think a simple LISP interpreter would be a great way to get started in programming. You can move on from basic maths (1 + 2) pretty easily to LISP. LUSH looks good http://lush.sourceforge.net/screenshots.html as it provides a complete environment including graphics and combines LISP with inline C, in a similar way to the way BBC Basic has inline assembler.
I have been teaching some youngsters programming with Basic-256 for kids they really liked it. Because it has a very easy syntax, and it has an inboard drawing pane. So the kids could draw stuff like a circle and get it moving.
// Will draw a red circle of a radius of 50 with it's center at (100,100).
From the Reference
Format circle x,y,r
Example
color red
circle 100,100,50
For kids this is a ZOMG!!! "Look dad! I made this!!!" *shows a circle that is moving*
I agree 100%. I started becoming interested in programming at that age, I found a C++ tutorial, and not knowing any better, I gave it a whirl. I got about as far as pointers and gave up, later I started on Pascal and got quite far, I wrote a few little DOS games that my brothers and I played, and I learned quite a bit. These days I still dabble a little in programming but it's not really my main field of interest anymore. The ability that I had to make my own decisions helped me learn tremendously though.
One thing I know, and that is that I am ignorant...
I suggest getting a small machine emulation like a 6800, 6809 or 8080, and teaching him assembler so he knows what's actually going on. Then teach him C, and explain what's going on there in terms of assembling and linking. Then teach him C++, then teach him python. That'll give him an expanding world he understands right down to the metal.
If he's got Aspergers' then this will work perfectly. If he's a regular 12-year-old kid, then he will get bored of register printouts within about twenty minutes.
Personally, at that age, I'd start by baking some cookies. Introduce programming as the act of writing a 'recipe' to explain to the computer how to 'cook' a particular thing. Probably start with programs to generate images, either using the line drawing functions in a graphics library, or by running through each pixel and colouring it based on a formula. Python should be fine (and certainly no less beginner-friendly than Pascal), if you learn it as a collection of magic words and leave the deeper stuff until later.
Rampant carbon sequestration destroyed the Dinosaurs' tropical paradise. I'm here to help repair the damage.
The key is not to Go Big, or Go Small, or Go Bare Metal, it is to go where their interest lies. If they really want to know about electron migration through a solid state material, Hell, go for it. But if they are interested in how to generate a web page, that's where you start.
Exactly. Well spake, sir, and I bet your students love you!
Rampant carbon sequestration destroyed the Dinosaurs' tropical paradise. I'm here to help repair the damage.
Have a look at Colobot or other games from Epsitec: http://www.ceebot.com/
The purpose of Colobot is to program bots to help an astronaut to colonize a new planet, starting by the Moon.
The language is very similar to C++ and you can design your own levels.
Most coding is rather dull to non-prgogrammers. Perhaps something motivational would be scripting or add-ons to a game engine to add your content.
That was an interesting feat considering vector graphics wasnt invented until the mid 1970s and raster graphics closer to 1980.
We had teletypes made available in our school connected to some local college. Basically it was just a BASIC interpreter. Aroudn that time Conway posted his infamous "game of life" column in Scientific American - one of several times he paralyzed the world's computers with trivial (Mandelbrot too). Life was both graphical. Also it leads to deeper levels of sophisticated data representation shoul you want to get any speed on the kilo-flop machines of that era.
Yes Mr Pedantic, I meant the "implementations of the JavaScript language are faster than any other implementation of other scripting languages." It's called a synecdoche.
v8, Tracemonkey and Safari's JS engine run circle around Python, Perl and, needless to say, Ruby.
One of the above post clearly says it: all you want to do in 12 is to see a nice 2D animated stuff.
As I've found, we don't have many "real" languages that make the simply-looking black drawboard easily accessible. In my 12, it was Borland Pascal with ega/vga BGI driver. I wrote stuff, pressed F9, wow it worked.
Today I'm seeing only various (unusuable) python libraries and several bad Logo implementations. C libs don't count, because kids can't compile them correctly (the magic F9 keypress ruled.)
So there I'm asking: is there some "use graph;" substitute for today Pascals (most suitably for FPC compiler, and probably running on redmondOS too?) or at least some nice IDE with run-the-magic button? I don't even care whether it's pascal or not, that one has just proven itself.
Sadly, I didn't found any.
You don't teach a kid programming. They learn it.
If the kid is interested in (his|her) own computer, then some Cocoa or Visual Basic will get the GUI baubles up pretty quickly. Pressing buttons and causing things to happen is possibly what's going to light the fire.
If the kid is fascinated with the outside world, I agree with ebbe11. Mindstorms is the way to interact with the outside world.
If the kid is interested in Facebook and Myspace and other web trappings, Greasemonkey is the way to go. Try to get a copy of the MWAP (Mafia Wars Autoplayer) as an indication of what you can do if you're interested. Greasemonkey can help script all manner of things with web pages, and the foundations of variables and function calls are all there, and easily portable to other languages.
I had my brother ask me where to start recently because he was interested in making his own games and already was fluent in 2d and 3d animation.
For him flash programming was a no-brainer as he'd already experimented and I so I found a good book that went over the basics that I knew he could build on.
I would suggest one of the following as a good starter:
Also html+javascript+css isn't going to teach programming unless they want to be a webhead.
python I haven't touched but by the sounds of everyone on here it would be another good starting point. I'd only say look around for online tutorials and see what's out there before starting.
get him to learn the basics - we all have been there and then start getting into the more fun projects like simple games and build on the skills he learns as you go.
Programming is hard but it can be very rewarding to see something you built working efficiently... and then making it work better!
HTML hardly constitutes "programming" in any reasonable sense. That's not to disparage knowing it as a skill, but regardless of what some people think, it's not programming.
While of course strictly true, I don't think that for the true beginner "programming" is actually the most important thing.
Learning to write HTML (okay, learning to write standards-compliant, non-lazy HTML) forces one into the mindset of thinking about how a computer is going to interpret something. Don't underestimate the effort involved in parsing a line of code, be it a loop in C or a row of table data in HTML; training one's mind to be able to walk through code of any flavor is a crucial skill to hone early on.
Some of my first efforts to make a computer do what I wanted programatically involved creating simply web pages (this was back in 1993 or so). It was very exciting to see the results of my work, and figuring out why my output didn't look quite right was, in effect, my first exposure to the debugging process. Eventually I wanted one of those newfangled email forms, so I next picked up Perl. (Yeah, please refrain from poking fun at my early language choices.)
So, HTML proved a "gateway drug" into software development. Many years later, I came to learn C, Obj-C, Python, PHP/MySQL, etc. "Programming" can wait - let kids start out with web pages.
(As an aside, I never did learn Java. In retrospect, I wish I had learned Java in lieu of the Perl and PHP I cultivated for server-side web work; while Perl has definite sysadmin uses, Java could have replaced PHP quite satisfactorily and would have been more broadly useful outside web work. Just advice I would give to those starting to program.)
If you want your kid to be happy and generally successful in general have him learn:
1) An instrument - Guitar or maybe piano. Something that will get him laid, something cool. Singing counts.
2) A foreign language - Anything but Mexican.
3) A martial art - ideally a -itsu, rather than a -do. Itsus are combat systems, dos are sports. Do will do in a pinch, but an itsu is more about taking the fight out of someone than scoring honorable points.
4) Financial management - Start with Monopoly. Teach him accounting, how to calculate interest and all that crap. Have him run a tiny kid business. There's a kid's version of the Cashflow game.
5) Dance - Let your son be the one straight guy who can dance.
6) Cooking - A great chance to show class.
7) Etiquette - Not which fork goes where, but not to offer his hand to a lady.
8) Flirting - This is a skill that can be learned. Also, teach him that girls come and go, that a kiss isn't a life long binding contract.
9) Fitness - A sport will suffice but the more important lesson is to stay fit. Start the habit early.
10) Leadership - Not sure how to teach this... but learning how to be a leader is a great asset for all aspects of life. Dudes will respect him, chicks will want him.
Utilizing the synergization of benchmark e-solutions to pre-workaround action items!
Get him hooked on Lego robotics sets. Logo (if they are still using it) is not that hard to master), and it can be a doorway to broader programming interests.
Helping him start his own web page with some JavaScript or other dynamic items could be another way.
I use irony whenever I can, but my shirts are still wrinkled...
The housing and banking failures where put on to faulty software because it did not stop the idiot carbon-based units from committing acts of stupidity.
So there are programmer(s) unable to predict future unforeseen events in his/her/their code and it's considered a failure. You can never predict the actions of idiots.
There are no loopholes. It's either legal or it's not.
To piggyback on this...and roll up a few aforementioned key steps:
1) See if he's got an interest first
1a) See if there's a program he wants that's not available for x platform.
2) Start with what he's interested in
3) Start with something easy in what he's interested in.
I started out with BASIC on an ATARI when I was about six(?)...then dropped programming until about two or three months ago when I got frustrated with the lack of Blackberry apps and decided to write my own instead of waiting for someone to do it for me. I didn't know object-oriented programming, much less Java or JavaME, to save my life (and most would say I probably still don't) but I hit up the Java tutorials and RIM API documentation. It was hard work, and I froze my own Blackberry a number of times, but three/four months later I have a working Blackberry app that wasn't out there before. I can confirm what the quoted poster said...it is very rewarding to see something you wrote work...and use it.
If you're not outraged, you're not paying attention.
perl would be a good starter language because it's syntax is fairly simple and it has similarities to C.
Why not just go the MS route. Yeah I know it's M$ but you have to admit with the Developer edition tools the learning curve is non existent. Visual C++ would be a good start, he could almost instantly begin to code, and the projects he could make would be easily distributable.
I only say this because you never mentioned specific OS platform.
I am Bennett Haselton! I am Bennett Haselton!
Really? You hate your brother that much?
Language choice doesn't matter. You can do simple things in any language. If it takes some magic to make it work, he won't care. The important thing will be to do something that's interesting. I would start off by developing a scene in POV-Ray. Then get into program flow using OpenGL and whatever language binding is handy.
So many languages... myself, like you, started with Apple Basic/Integer Basic, then moved up to 6502 programming and now.. well.. let's just say I've probably most languages out there. If I was a parent today, I would want to kill 2 birds with one stone. Use programming to further his maths skills as well as new computing skills. If you have Microsoft Office, go that way and get him to do some VBA with Excel for his maths skills, that's especially good to get the graphs and pie charts and the algebra. That being said, ASP (not the .net) version is available as part of the personal web server that comes with XP, so, VB comes to play again, he can leverage that as a fun introduction to web page. Finally, get some Javascript to further his web programming skills and since JavaScript's core roots are in C/C++, eventually, you can jump to C/C++ to show him where all this high-level stuff comes from. Anyway, I'm sure there are a lot of opinions on this, but this is what I would do.
Probably the best thing you can do for the kid is to have him start with Java.
That way he won't be tempted to become a programmer.
Seastead this.
I am amazed about how many others started with QBasic like myself. That is not a bad thing, I was just unaware and think it is cool.
If the dude is interested, maybe start on QBasic. If your brother wants to just do cool looking stuff, maybe show him how to do flash or something of that nature.
The world is how you make it
No sense teaching him the weird indentation fetish that comes with it. Just too fucking bizarre.
Personally, I went from BASIC to C in high school. It was about 28 years ago. And then had to learn Pascal when I took a course in community college. After I dropped out, I took my first job as a wiz kid, and had to learn PL/I and assembler.
cat
They don't think abstractly yet. There is a reason that Algebra isn't usually taught until grade 9.
All the success stories I've heard with teaching programming to 'little people' have been using an interactive graphical language such as Logo. Initially you use it as a keyboard controlled etch-a-sketch. When you show that you can define a subroute 'Box' that draws a square, then a subroutine 'window' that draws a 4 pane mullioned window either the eyes light up, or you get a 'so what, I want to play hockey' look.
Sure there are some kids who would dig programming right away at age 12 -- I suspect that a large fraction of /. readers are from that group. But most kids aren't.
If you don't work with something like LOGO, wait a couple years. Mean while, show him examples, and give him stories where the hero is a programmer. (Short list that...)
Third Career: Tree Farmer Second Career: Computer Geek First Career: Teacher, Outdoor Instructor, Photographer.
Python is a fair suggestion with something like pygame. It has the upside of teaching them a language they can use in future endeavors, AND will seem interesting to a youngster by peaking their interest with graphics and sound. How ever, there is some overhead to using pygame, and python's syntax isn't all that similar to other standard oop languages.
I'd suggest starting with a language that can easily offer graphics/sound/etc. for sandbox play, AND uses a syntax simular to the ECMA java-like standard. I believe that will help with the transition to OOP C++.
ActionScript is probably the most enticing language you could teach to a youngin' since it is tide to a graphical editor. If you start with AS2, you can skip all the complications and make a game by jamming a few small lines of code in strategic locations in a few minutes. You can then continue to concentrating on key rudimentary ideas while making playable games, or extending a game by expanding on previous example. You can slowly start bringing in proper structural elements that make make it more and more like AS3, until you basically ARE using AS3.
As languages go, AS3 has a very nice structure, so it's a good environment to teach proper practices. and it is easy to start AND complete projects that would actually seem interesting to a younger audiences. As an interpreted language that also compiles, there's quite good error handling, both at compile time and during run-time. Troubleshooting can be a major deterrent to a learner's progression, so useful error messages for all errors is important. Also, having the ActionScript help bible embedded into the IDE is quite handy.
Downsides:
You need to buy the Flash Suite to get the proper experience out of it.
ActionScript isn't a very applicable language in that, you can't use it anywhere other than in Flash applets.
It doesn't have a very simple file IO system, which is often helpful in many teaching examples.
Vim, Emacs (the GUI versions of both give menus with the commands so you don't need to memorize keystrokes), and Notepad++
Consider Ruby. 'The Well-Grounded Rubyist' is an excellent (new) book that I'm currently working my way through. Very good teaching of a fun language.
HTML hardly constitutes "programming" in any reasonable sense.
I know that full well, but it always gets brought up in these kinds of discussions. We might as well stop and think about why.
What are the similarities between writing HTML and programming? (Let's just assume there is _one_ HTML, and I'll get back to why that assumption is okay to make).
* (a bit string that makes computers do something more or less exclusive to computers; i.e. not an mp3 bit string or a jpg bit string, but a web page bit string** or an ELF bit string or a ...)
** (yes, it's really just text; it's really the internet/browser medium and its peculiarities that're interesting here)
What's the main difference? HTML can't really compute anything. There are computations involved in rendering it, sure, but you can't say <add>2, 2</add> and expect $BROWSER to render 4. I think this is the part which people who say "HTML isn't programming" like to point at.
Going back to the similarities: what do you learn by writing HTML? You learn that you can bend the machine to your will, if and only if you pronounce the right magic spell in the correct way. Some mispronounced spells just do the wrong thing (what does 'bgcolor="ff00fff"' render as?), while others make your magic lab explode (no body text gets rendered).
These lessons are fundamental to programming (and, really, writing instructions in any formal grammar; Apache configuration files spring to mind, as does sendmail line noise).
I think this is the first important reason why it always gets lumped in. The second is that it tends to attract the same kind of people: people who like creating "computer-somethings"; some of these will transition into doing real programming.
How about writing BAT files (windows shell scripts, for those who might not know ^_^)? The DOS(-ish) shell is rather limited in what computations you can express. You get to manage control flow, but the only data you really get to manipulate is text. Is that programming? I think it may be fair to lump it in, but just barely (or I only learned a subset?)...
When you hear "$PERSON wants to learn programming. What do I teach them?" and next hear "HTML", you might appreciate why that answer isn't (necessarily(!)) stupid or wrong: you do learn something that's useful for programming from doing not-programming.
I strongly recommend old-school BASIC. It's a fairly straightforward imperative language that will introduce people to boolean logic, branching, and loops. It works really well as a simple platform for writing algorithmic code.
Later on, the transition from writing GOTO based code to GOSUB based code will be a good introduction to functions. And before anyone says that GOSUB != f(), I want to point out that it's surprisingly similar to the way function calls are implemented in machine language.
I think you should avoid strongly typed languages, there's no need to get tripped up about the differences between int and float until the student gets more serious. I also think you should avoid object oriented languages in the beginning also. No one would recommend learning VHDL before learning gate-based logic circuits, why are so many people advocating learning very high level languages before learning algorithms?
If the student really takes to programming, they'll probably transition themselves off BASIC in a month or two and go pick up all those other techniques and concepts on their own.
1. Teach the kid HTML first (Teach Yourself HTML in a Weekend book).
2. Then, teach him JavaScript. A number of good basic books on it in stores and libraries, plus a lot of online resources. It gives some programming basics, but removes the overhead of a compiled language.
3. From there, with a little bit of work on how a computer handles memory and executes programs, teach him C.
Note: The above is route I taught myself to program in C (eventually) and then C++ and Java. HTML did not take long at all, and I found it useful later on for other things I wanted to do in or with web pages/sites. A gradient approach, yes even the gradient approach of typing in HTML in a formatted and easy-to-read way, pays off when you then have to write C or other code.
Caution: After I learned HTML and JavaScript, I took a stab at Java, that was too much of a leap at the time, I got good enough in Java to create endless exception errors, yeah! However, I then moved to C and that was an easier transition. Once C was done, I then tackled C++ and eventually got back to Java. I tell you, having C under my belt when I went back to Java helped a lot, despite the differences in the language and how Java operates (virtual machine) compared to close-to-bare-metal C.
You should take a look at SimpleJ, which was made precisely for teaching kids how to program. It emulates a simple 80's style game console and has its own language, with a Java-like syntax (but it's not OOP). The IDE allows you to run code immediately, it has a very decent debugger which shows you graphic representations of data structures such as linked lists, as well as all local and global variables, etc.
There's even an eBook, but it's in Spanish (SimpleJ is Made in Mexico). But it's free software and really cool, try it out.
Go hug some trees.
I'd agree with the go where the interest is, my thoughts were how I programmed at a younger age than that in a bit of machine code and then assembler and basic. But that was fine because it was my interest driving me (and trying to show off to my dad to whom it was all just as new that I could do it better).
Put simply you will never get them learning if they aren't doing things that interest them.
Once you have the subject you can choose a language appropriately (assembler, C, Java, Python and on and on). Best using the ones you know best really and just highlighting they have many choices out there to discover for themselves later.
The real problem with teaching kids to program in to get a problem they want to solve.
You should try Alice. At SC08, I saw a room of 8-14 year-old kids doing Alice, and you could not tear them away from the computer. The original Alice was designed for middle-school girls, but Alice 2 has all the Sims characters, so kids can create a virtual world. And even better, the new Alice spits out a NetBeans project and Java code, so you can make the jump to "real" programming.
http://www.alice.org/
You can use the bare minimum on Emacs, such as "Open" and "Save" through the Menu toolbar. Don't need to know all the shortcuts nor Lisp to start working. And by the time a youngster needs the shortcuts, he can learn them faster than you think is possible.
I am forced to work on Windos lately, and even with cygwin, it is abhorrent for programming.
It's visual, promotes imagination, and has a fantastic online community where your kid can share his project, get feedback, ask for advice, etc. http://scratch.mit.edu/ great article from ACM to whet your appetite: http://cacm.acm.org/magazines/2009/11/48421-scratch-programming-for-all/fulltext good luck!
If you don't mind giving the youngster a somewhat graphical and simple approach to programming, I highly suggest using Game Maker. It is a graphical game creation tool that also includes it's own scripting language that is very easy to get a hang of.
One of the more interesting aspects is that anything that is done with the icons or Drag and Drop items can be done through scripting creating a nice staged approach to learning programming.
It was created by a professor named Mark Overmars as a teaching tool to get children interested in programming.
http://www.yoyogames.com/gamemaker/
It has very basic OOP functionality built in with child and parent objects, and you can actually create some pretty interesting applications with it. The problem is that is a bit too fun and you will need to encourage your child to use this solely as a launching pad and not a final destination.
I remember once asking the best programmer I knew about which language he thought would be the best one for a particular problem I was working on. He said that he thought the best language to use would be the one that I knew best.
Have him read: The Little Schemer.
I would suggest against ASM as a first step. Kids of the last two decades (myself included) have grown up around computers, they're already thinking several levels abstracted from the bare metal, and when they think 'programming computers' they probably want to see problems and results at their current level of abstraction and understanding, and gain knowledge they can use.
When a person mostly understands their current "layer" is when they should move up or down in abstraction. Given a one-on-one scenario, I suggest asking about their interests and find out where they are the most knowledgable, then use that as a starting point.
Teaching them about registers and opcodes will probably not integrate with any of their current knowledge. Much like in school, I disliked math, not because it was hard, but because teachers could rarely relate it the my world or current knowledge. Basic mental methaphors. We're not building a house, we're building a network of information. Foundations matter, but they're not always the starting point.
Link to this website: http://openbookproject.net/thinkcs/python/english2e/
So as long as you use Emacs as if it were notepad, it won't be complicated.
I'm a software developer, and having done it for a few years now, I spend my free time brewing beer and baking bread. Sometimes dealing with less rigid systems is far more enjoyable.
Why doesn't anyone mention PHP?
OK, now that you've stopped laughing...
Really! With PHP you can kill two birds with one stone: You can teach HTML so you can be productive right away, and you can just embed some small PHP in the page wherever you feel like it... rather than programming a page to spit out HTML.
Now you want to make it do more complex stuff? Just add more tags into a working project. Now you have a powerful language that you can branch out and learn how to connect to a database, for example -- way beyond simple scripting stuff. Database is where its at!
"They said I probly shouldn't fly with just one eye," "I am Bender. Please insert girder."
Get him an Arduino. That way you can kickstart him in both programming and electronics.
Also, the Arduino was actually built for people that don't already know how to program.
And kids love blinking lights :D
When I started a while ago before actually starting python and raking my brain out on project euler, I started with a simple scripting language called AutoHotKey for Windows (any). It is extremely easy and took next to no time to learn. It helped me get my head around programming rather than throwing someone in the deep end.
Most kids like to write some kind of game as their first program. It's immediate enjoyment, and something they'd like to play with when it's done.
So a good start for learning programming might be GNU Robots. In it, you write a program for a little robot, then send it out to explore a world on its own. The robot has to run autonomously, using the program that you gave it to navigate obstacles, avoid (or destroy) enemies, pick up energy tablets, and collect rewards. And you get to watch the robot do its thing, so when it's done you can immediately update your program and try to improve it.
GNU Robot programs are written in Scheme, which should be fairly easy to learn.
(Disclaimer: I'm the original author of GNU Robots, although I turned it over to someone else after I released version 1.0D in 2000.)
I'm not convinced this is the best way to begin. I think you should start with the computer equivalent of an explosion. Give the student something they can manipulate nearly instantly and see results in real time as changes are made instead of the tedious non-interactive write/compile/debug rigamarole. There's plenty of time to explain the details once the hook is set. The questions as to how the underlying code works will come, and NASM will be waiting patiently. Logo was an effective starting point for many of us in the industry and it's not because the syntax of Logo is universal or even relevant to the work we do now.
by Mike Buddha -- Someday the mountain might get him, but the law never will.
You might want to check Scratch: http://scratch.mit.edu/ It's free, runs on Linux, Mac and Win and let's people share their videogames and animations on the web. It was discussed before here: http://tech.slashdot.org/article.pl?sid=07/05/15/1420238 For those interested in connecting to the physical world you can get the PicoBoard or the LEGO WeDo which interface with Scratch
Why not learn C? It's as easy to learn as basic and pascal or python, or php.
Easy. Teach an eleven year old to program, and wait until he turns twelve!
And before you ask the obvious question: you teach a ten year old and wait until he turns eleven.
Sigh. Some people just don't get recursion.
I am anarch of all I survey.
Herrn Mace,
It gives me MUCH pleasure to respond to your criticism of "Windoze" and "M$", it is not fun, it is just a a way of expressing my severe displeasure, in English, of the illegal and venal conduct of one of your largest corporations, but we are aware that they have already bought you and expect no better.
We understand that your fully corrupt system of government will not ensure that existing Court decisions are enforced, nor proper investigation and prosecution brought, eg in the corruption of ISO.
We also understand that M$ now has a corps of shills, such as yourself, and astoturfers to infest mailing lists as you are doing.
I look forward to seeing Gates & Balmer in a Super-Max for perjury.
You have LOST, throwing chairs will not help!
Ich wünsche allemal, außer Ihnen, auf Slashdot ein frohes und erfolgreiches neues Jahr
Yes, lots of us have helped to port good stuff to Windoze, including a number of For Profit outfits like ActiveState who do Python, Perl and TK/TCL, and lots of ports sit on Cygwin which provides a POSIX api on Windoze. You CAN assemble a tool chain on Windoze by hand (more easily with MINGW), especially if you know Win32/64 api, POSIX ... and the xtool you want to port, and best have done this 2-3 times, to put together a usable tool kit on an enterprise locked down machine takes, maybe half a day, if you bring all your tools on CD or stick.
...
My original point is that is MUCH harder than learning programming, Linux distribution vendors do the dependency resolution and packaging, and because Bill cant tell them how and why to screw their own users, the entire ball-of-wax works. So DUMP Windoze if you can, else use Linux as a virtualized system, or if all else fails use Cygwin.
One other advantage of Linux is that it offers multiple desktops, and since it dosnt crash much, you can have contexts open for months
I started as a child to program with Visual Basic 6.0 about 10 years ago.... i think its the best choice for a child.... it get me very fast to the graphical development but also show me the basics about variables, function etc etc i think it going to be the best choice but try to find version 6.0 cause newer version are very complicated..... :)
The kick I got from modifying Commodore VIC20 BASIC programs was that I could easily make it do things. For me, creating a loop where x was incremented and printing out the correct final value was just fascinating all in of itself. If the little-brother has no interest in such minutae he'll likely be a very poor programmer.
If I allow myself to assume that the whole point is a reaction to a request from the 12 yr old, and not as it appears simply another of those HowToTeachKidsProgramming.post("/.") or worse a misguided attempt to make the little-one into a facade of the older-one then I would advise this course of action:
Ask him to describe delivering a newspaper (or some other manageable short task). First thing you'll notice is he thinks about delivering newspapers, not just a single newspaper. Then he'll spin about with monster robotic solutions. He'll not initially notice that there is an address lookup to the routine. Probably traffic avoidance will be his focus but properties have boundaries and some customers get really aggravated when you don't keep to the concrete walks. Point is, it's fairly hard. And harder to explain.
In short, the best language to start a pre-pubescent or adolescent into programming is his native spoken language.
If I allow myself a further extension and consider how to nurture a beginner who has interest and maybe has poked (see what I did there?! ;) around a little with programming environments or tools and has been mostly unsuccessful, I would suggest a shell, even command.com if necessary. I think being able to list and manipulate files and iterate through file directory hierarchies poses enough of a challenge to assess the student's organizational and motivational resources.
I would urge that an early lecture would cover Leverage (effort vs. work done). The right tool and language for the right job is an unbeatable combination. He should know early-on that C++ is not something to ftp files into your database, usually.
Do put him in front of the environment early on, even if you advise that it may seem too hard at first. The newspaper example can be redirected as a copy a file shell script. And you can show him how to stub out the address lookup (and explain that such 'hard-coded constants are a bad thing'. And you can grow that into a full-blown model of the domain, actually.
It's not about language.
I'm maintaining _why's Hackety Hack, which was built specifically for this purpose. It's still in "not quite 100% ready yet" mode, but you can at least keep your eyes peeled. I'm also quite open to thoughts and suggestions. http://hackety-hack.heroku.com/ http://github.com/steveklabnik/hacketyhack
Spend a little time on LOGO to show some basic concepts and then onto Python.
Have him start with mainstream languages and tools - the ones whose sole purpose is to make programming life easy. Visual Studio > Visual Basic Express. Loads of examples and tutorials out there geared toward youth. The migration to Visual C++ will be easy since he will already know the IDE.
Another useful Python learning environment is RUR-PLE: http://rur-ple.sourceforge.net/en/rur.htm
First, does your brother show any interest or at least curiosity in computers? This is a pre-requisite.
If he does show curiosity then you must first try and understand what motivates this curiosity.
Is he interested by the looks of an application, is he interested with the creativity, is he interested with how things work?
The answer to this question will entirely change how you should approach your self-given task of teaching him to program.
When you have found out his main motivation, then you need to tease his curiosity further by giving him simple examples of things to do and helping him to achieve this. Onl then can you start figuring out which language might be best.
Personally I started with Logo (http://en.wikipedia.org/wiki/Logo_%28programming_language%29) - in my opinion the best language ever to get started with great ease with a key advanced programming concept: recursion. Then I went on with Basic (eek) and Pascal (great). Pascal (non-OO) was indeed very educational in that it allowed for great creativity and helped understand how a simple language actually worked (including insight into how compilers function).
But soon, like you suggest, you need to get to a full blown language for a wholesome experience. Nowadays the choice is wide. Personally I would veer towards an interpreted language with an easy GUI toolkit. Python + Qt sounds like right the thing to me - but then again I'm sure you can make it happen with pretty much anything available.
The key to teaching is not so much what is being taught but how it is being taught. If your brother is having fun, he'll learn anything. If he sees you having fun, he'll learn it quicker again. So you both need to be enjoying what you teach him (you must be familiar with whatever language you choose to teach him) and you must find ways to make it enjoyable for him too (with pragmatic and quick results to begin with and gradually increasing difficulty - it is essential that you teach him the basic problems: sorting, recursion, human-machine interfaces, how memory allocation works, you'll soon talk about multiple threads or tasks and dead-locks, live-locks...).
Enjoy.
1. Make him or her like a challenging game.
2. Show that he or she can win by changing the game from the inside
At least, this is what happened to me when I was 11, playing games that were written in BASIC.
This is exactly correct. "Programming" is farther from a one-size-fits-all skill than it's ever been. There are so many different areas and specialties. It's nice to have a sense of certain areas, but there's no way to be an expert in everything ("jack of all trades, master of none"). Some people are just more suited to certain areas or types of programming, or just enjoy it more. No sense forcing someone who loves to design games to write print drivers. Think of some of the extremes: writing kernel code/drivers; writing music software; home/industrial automation; "business applications".
I know people who can write great APIs, but make the suckiest user interfaces ever.. and likewise, people who can create beautiful intuitive interfaces, but have to rewrite their API every version.
It's probably early for a 12-year old, but one of the most important things is knowing there is much more to programming than writing code. If you're writing photo editing software, knowing about color theory, how cameras work, etc will take you MUCH farther than knowing (insert language here) really well.
This can go the other way, too. This might be good for a kid, actually. Maybe s/he loves shooting off model rockets. To get them interested, try writing software to help design them or figure out how high/where one will go (eg it can read weather forcecast off the net to get wind speeds/direction). This alone would work because it's a program that actually applies to them to solve a real problem, but it also starts teaching the value of integrating knowledge of programming with knowledge the problem domain.
Speak before you think
Which all counts for absolutely zero if the kid isn't motivated to learn it. Find me a 12yo that gives a crapola about anything on your list and I'll show you my butt. Yes, my butt.
If a given 12 year old isn't motivated to learn Python, they're probably not going to be motivated to learn much else, which would make the whole argument moot. See http://www.pygame.org/docs/tut/chimp/ChimpLineByLine.html for a short justification of this.
Does your younger brother really want to learn anything about programming as teaching programming is not about teaching a chapter in school !You have to be a born programmer!!
Yeah, its a Microsoft product, but its not half bad. Has exactly what you asked, an easy to learn language (BASIC) that is actually usable in real-world scenarios.
NEVER teach C or Java or Assembly to a first time programmer unless they are really bright. You need to teach a person how to develope reasoning and logic first before they start worrying about syntax and object oriented stuff, and Basic is a great stepping stone. The advantage of Visual Basic is suddenly you are in a GUI enviornment, and once you learn the easy stuff, you can actaully get into object oriented stuff.
But yes, in the end, stick to Basic, GWBasic, or Visual Basic. You have got to have that foundation of understanding programing Logic first and formost. After you have that foundation, you can fairly easily jump into any other language.