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.
Lua
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.
Just released and has potential to make programs along with games. Can also do 3D for the advanced crowd. Very easy to program with. Can begin with drag & drop actions to easily learn structure.
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.
HTML fascinated the hell out of me, so i tried it, made some Pokemon websites, try something simple that has impacting results when previewing the code.
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?
I once remember someone talking on IRC once about his childhood. He was 'caught' trying to learn BASIC at around age 7 or 8.
Fortunately for him, his father was a professional. He gave him a copy of a C tutorial book targeted to kids (I can't remember the name) and a compiler, and warned him that he'd be grounded if he ever tried to go back to BASIC again.
My parents weren't as informed, and I had to suffer through GW-BASIC from second grade onward, moving on to complicated VB Excel macros and JavaScript in middle school for lack of a decent compiler / any sort of supervised learning throughout. I'd highly recommend avoiding this 'approach'.
Suggest the 12 year old starts with this book... Learn to Program, 2nd edition, by Chris Pine. http://pine.fm/LearnToProgram/
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
If you want to get him started quickly with something he can play around with on his own there are a lot of languages which now exist specifically to teach young kids. Check out Scratch from MIT (It's a visual language for making interactive animations with sprites), or Alice from CMU. There's also TurtleArt which is a graphical representation of Logo and has a number of mathematical blocks in it. Once he's having fun and doing something exciting then transition him into a more formal language like Java, C, Ruby etc. As previous posters have said, the language itself isn't nearly as important as the IDE, and because of that I'd recommend going with Java or Ruby when you transition. Java has some good learning IDEs like BlueJ or WhyLine and Ruby has a number of environments with interactive tutorials. Your brother might even enjoy reading Why's Poignant Guide to Ruby, which is available free online (though as many people seem to hate it as like it). There are lots of tools available to teach programming these days and you don't need to rely on the same outdated examples that bore most kids.
Also take into consideration that Java then C are currently the most taught programming languages in universities, while Java, C, and C# are the most commonly used languages in industry (though this is starting to change).
Check out Processing (http://processing.org/). It's easy to get off the ground quickly, comes with an IDE, and offers a lot of simple primitives for drawing and sound.
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.
It's simple and portable and provides a graphical/alphanumeric display. It will introduce him to variables and conditionals and loops and stored procedures. And it could be immediately useful to him in his studies.
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.
I don't know if I am a good example, but I started out in 6th grade with a cheap program built for kids that used BASIC to build games. It included short little skits with cartoons to teach each individual command and including syntax. It was not very useful and hard to deal with at the time, but it laid the path for basic programming flow. Also that same year I discovered my sister's graphing calculator, which I then also started programming in. These were all very basic, but my sister appreciated the help with her tests in algebra.
After this primal sprites builder and programming IDE I moved along to a book that I found of my father's, which was Learn Visual Basic in 24 Hours. I instantly installed the software and began reading. It wasn't until I started browsing the internet did I learn a lot more. The book was very limited on what it taught. A big part that helped me in my programming discovery was IRC. At 13 I was all over IRC where I found a lot of information. Beyond anything that a book could ever hold.
Once I hit High School I moved up to C/C++ and eventually started programming for our school's FIRST robotics team. This is where I learned a lot of electronics and engineering as well. I ventured off a lot in electrical engineering. Anyways, C++ led to every other programming language you can think of. (i.e. Perl, PHP, Java, SQL, Python,Ruby)
So to answer the question: Possibly BASIC might be a good route. QBasic would be good. Another option would be Ruby or Python. These are very simple and could be dissected and understood by any 12-year-old, with a little help that is.
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.
The snake that will die one day.
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.
Personally, I picked up C as my first language when I was 12, so I know that other people can do it, too -- depending on how dedicated he is.
Another thought is PERL; I have a friend from middle school that learned PERL as his first language when he was in 8th grade and continued to use it until college, when he switched to python.
Finally, PHP could be quite nice -- simple, C-style syntax with capabilities out the wazoo, plus it allows him to use either structured or OO style programming and transition between the two, depending on where he starts. Another nice thing about PHP is the ability to make things happen quickly. In other programming languages, if a person wants to set up a GUI, there's (generally) a lot of work involved. With PHP, it's very simple (and we all know that kids like purdy graficks).
Ultimately, as others have said, it depends on your brother's personality and interests in the first place, but I'd say that any of the three could be good places to start.
Either Lisp or Assembly. If you go the assembly route pick an architecture like 6800, MIPS, ARM, AVR.
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
My brother tried with all his might to get me into QBASIC when I was that age. I refused to use it, because it looked like a shitty language compared to C/C++. I also avoided PASCAL like a plague because it looked ridiculous and no one was really using it for anything meaningful. JAVA didn't exist back then.
I also refused to use C, when I saw how much more sophisticated C++ was. As a result, the very first language I taught myself was C++ when I was 13. Then after I became proficient in it, I learned to code C and became a C bigot for awhile due to the fact that C++ was more bloated and cumbersome. I used Linux and C throughout all of high school, and hung out on #c on efnet.
When I got into college, I decided to focus on C++ again because at that point I started to realize the strength of OOP designs. Even though the programs were longer, bloated, slightly slower, and more cumbersome they ultimately led to more interesting programs and easily maintainable/readable code. I still avoided JAVA which now existed, for the same reasons I had left C++ originally.
After I graduated I got my first job because of C++. Though, while on the job I began to see the benefit of a language like JAVA for simplifying cross platform development and GUI development. This is because, for the first time, I was forced to code MFC on Windows for GUI development, which I had not yet been exposed to. It was to me the most disgusting API I had ever seen in my life. I was required to do it because the lead developer had developed their Windows program with MFC using ATL which *supposedly* made it easier to read but not by much. The move to JAVA for me made sense because of the pristine GUI API and also because the owners of the company wanted me to port the MFC application to Linux. I ended up rewriting the application in JAVA on both Windows and Linux and we were able to make it into an embedded application in a very small device even which is something they had always wanted to do.
At this point I gave up C/C++ entirely and became a JAVA advocate, I also tried my hand a year later at C# and rewrote their application in C# on a handheld PDA using the compact framework. I made one of the biggest mistake in my careers when I wrote a memo criticizing their inability to hire a proper manager. They had laid off my manager and as a result I didn't have any direction and was just coding random software, which while fun was leading to situations where I was being yelled at for not having focus and being given poor yearly reviews. So, I had written an email to one of the managers of the EE department, who was the one yelling at me, stating that because they refused to hire a proper manager and were having me managed by his son who never showed up to work I didn't deserve to get bad reviews and I refused to sign off on a poor review, I said I'd rather resign. Then bam, next morning he sat me down and shook my hand and said resignation accepted. I was out the door minutes later shocked with all my books in my hands. I never thought they would essentially fire me, because I was their only good programmer who knew their platform inside and out and I was such a hard worker.
My next job, which I got about eight months of job searching required I go back to C++. They didn't like C# or JAVA and only wanted their code done in C++ and Visual Basic 6 lol. Of course, I turned my nose up at VB6 but I learned and coded it anyways because they demanded it. I also learned VB.NET with the hope they would let me rewrite it, but they never did. I wrote some programs for them in C# that they ended up allowing, though they didn't like. They ended up laying me off, after a couple of years, even though again I had become one of their most proficient programmers and they had invested a lot of time in me. I think my lack of focus and programming in languages they didn't like probably again led to my dismissal. That, and they replaced me with cheap labor from india. I met one of my replacements as I was on my way out, he had only been in the countr
At 14, I've fist time start something to program... it was Basic, after cca 6month a moved to Z80 assembler. I think it was a very good practice. After 20 years I've been looking at this way that it's perfect to start with some 'smell' of algorithmic thinking and then move to deep dive to roots for a while. In young years it could be benefit cause of ability of young brain to absorb such huge quantum of informations. Details are gone after years, but something like right intuition lasts, which is great benefit in next personal IT movements. ;-)
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...
Visual Basic, preferably 6.0, preferably running on XP.
If he takes to VB, then that can lead him easily enough to C. With full access to the API there is not much that VB6 cannot do that C can, including pointers, raw memory blocks, pointers into raw memory blocks, subclassing, etc. I don't program much anymore, so I'm not sure what VB.NET gives you programatic access to in a Win7 environment.
If he takes to using the VB->API bits, then something like OpenWatcom, which can lead him into DLL programming without getting him dependent on MS' Visual Studio interface. The reason being that if you're familiar with other IDEs, you can get accustomed to VS, the corollary is not necessarily true.
With that said, don't pressure him. Keep it fun for him and back off if he shows no interest.
Check out http://javabat.com/ for coding practice (the *teaching* of the material is still a problem, but JavaBat is great for practicing)
There's this book called "Hello World!: Computer Programming for Kids and Other Beginners": http://www.amazon.com/exec/obidos/tg/detail/-/1933988495/ref=ord_cart_shr?_encoding=UTF8&m=ATVPDKIKX0DER&v=glance
I didn't actually read it (it's sitting on my shopping cart for a long time), but it's got good reviews, if only a few.
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 think it's best to get him going with something that shows results quickly. I would recommend to start him with HTML and CSS and he'll see how things come together and then start on with JavaScript if he wants to do something more complex. If he's still interested, he'll pick up other areas by himself, but HTML, and CSS should get him going to have something on the screen that he owns.
Lego Mindstorm comes with a great Virtual Lab for kids. Let them visualize first.
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.
How about Processing? Allows you to create some cool interactive projects, with great graphics support. Also a natural if you want to get into Arduino programming.
www.processing.org
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.
start off with HTML coding.
Teenagers like to see instant results and HTML language is fairly easy to pick up. You can help with setting up a website for the teen and then can go from there.
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.
Javascript is for pussies. Teach him brainfuck.
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
I started programming at a very young age. Similar to you, I started with BASIC (Atari 800 for me) and moved to Turbo Basic, Turbo Pascal, C++, JAVA, C#... and somewhere along the way I picked up FORTRAN. For a young man around 12 years old, I would suggest an interpreted language that would quick show the cause and effect of what has happened.
I know how much Slashdot love MS, but there's this:
http://msdn.microsoft.com/en-us/devlabs/cc950524.aspx
The Mono project is also very awesome:
http://www.mono-project.com/VisualBasic.NET_support
Last but not least, jump right into JAVA with NetBeans. The IDE (although bloated) holds your hand through a lot of things.
If there's a struggle with understanding, then good ol' HTML is a quick way to see results. After all, the 'Hello World' and making your name appear on the screen in different colors and blinking is very exciting when you're young!
I tried to get into c++ at that age but quickly became discouraged; lots of complicated typing for 'text only' results. I wanted to see some action!
Then about five years later I heard of a game called 'ColoBot', which is a 3-D adventure game in which programming in a c++ like language is the core of everything you do; you have a small group of robots on an alien world and you code their AI to perform tasks, from resource collection to building to attacking enemy aliens.
I became instantly obsessed with ColoBot and writing better code for the robots; I played the game late into the night and arrived at work sleepy the next day for weeks.
After I had become comfortable with ColoBot, it was easy to make the transition to actual c++ and creating my own games; my ColoBot experience had given me the confidence and the high-level understanding of the concepts to make the jump.
The real key was that ColoBot felt like playing a video game, though 90% of what I was doing was imagining new types of tasks, coming up with code to perform them, and then debugging and improving the code over and over. ColoBot kept me interested with graphics, effects, missions, etc... until I was ready for the real thing.
Though I've read /. for years, I've never posted here (hence anonymous coward), but I remember thinking 'where was this game when I was 12!' about ColoBot, and its effect on my own subsequent computer science experiences was too profound not to share.
Good luck!
Programming?!
Tutor him in math, science, money, and other things that will get him ahead in life = so he can go on to much better things than programming.
Teaching him programming is like teaching your kid how to be a janitor.
And no, math has nothing to do with programming. In all my years, the most math I ever had to use was some high school level linear algebra - even at the CAD company i worked for. They hired math grad students to do that algorithms for the calculations and they coded the number crunching. Us CS guys just wrote the GUI, plotted points on the screen and file management stuff.
Or teach your kid plumbing or electrical - something with a future.
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.
Best Introduction To Programming For Bright 11-14-Year-Olds?
Or is your brother not bright? :)
You could always try searching for yourself....
http://slashdot.org/index2.pl?fhfilter=askslashdot+language
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
6502 or Z80 Assembly to start.
68000 Assembly (luxury in comparison) to follow.
By the time they get to high level languages, they'll actually have a clue how it all works underneath, how to write safe code, how to conserve system resources, and a host of other things - many of which translate directly into C programming practice...
Of course, your kilometerage may vary....
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.
All great languages for beginners:
Scratch, ActionScript 3.0, MySQL, Sqeak: SmallTalk
http://scratch.mit.edu/
http://www.squeak.org/
http://www.amazon.com/Squeak-Quick-ObjectLand-Gene-Korienek/dp/0201731142
Start him with APL.
I hear TECO makes a nice IDE as well.
Seriously... QBasic would be a good start... I started on speccy basic and having the ability to easily toy with graphics made it very appealing. If he's in any way mathematically inclined, demonstrating how simple maths or even simple arithmetic can create all kinds of interesting patterns could pique his interest. As much as I love C, I agree with everyone else saying that its too advanced for a beginner. The shell script idea mentioned above is an interesting concept however. Either way, set him up with a code environment that allows him to experiment... so going with the QBasic idea, if he wants to code a game, you should write the code for him to switch to a graphics mode, get key presses etc. etc. so he can concentrate on the meat. I found that learning by altering example programs and seeing what happened was also incredibly effective.
But the key thing is, as many other people have said, if he's not into the idea then there's absolutely no 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.
With Tcl/Tk he'd be able to immediately start writing GUI programs, which may keep his interest more than just command-line stuff.
Try "scratch" it's a simple graphical language.
I find that the problem with most languages is that children want simple ways to do "cool" stuff. No one gets excited with plain text
http://scratch.mit.edu/
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)
Scratch is a visual programming language from MIT with object-oriented structure and instant ability to create a new graphical game. I used it to teach a homeschooling class with 10 and 12 year olds, and they were way ahead of my detailed knowledge by the third class. Then some of the students headed into Python with me as a next step.
Evidently the new Android Creator from Google will look a lot like the Scratch interface. Strongly recommend it!
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.
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, use Fedora, SuSE, Debian or derivatives and, when the install is done you have an OS and full tool chain
...
... ddd, gdb, valgrind ...
Editors: vi, xemacs, gedit
Compilers: C, C++, Fortran, Pascal, Ada
Managed: Perl, Python, Java
IDE: Eclipse
If you have to do it on a Windoze box, Virtualize, or as a last resort use cygwin.
I realized that girls love to personalize their stationary with characters, sqiggles and poems.
It was a school break and i was tired of her playing stupid flash games. so i showed her the real basics in making a website and gave her a "HTML for dummies" book. Of course, the first page she created was to slander some of her schoolmates.
I enticed her into javascript with the standard "hello the day is Monday". I was suprised at the stuff she could do with dialog boxes.
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.
Definitely I'd say processing - www.processing.org. It's based on Java, with a very simple IDE, just open the text editor, type some code, and press run (check out the provided examples). Then also the path to C/C++ is relatively painless (for C++ i'd recommend starting with openframeworks, www.openframeworks.cc)
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.
Quick Answer: Python
Thoughtful Answer: It's not about the language, but the concepts. :-)
Start out with an electronics kit and get them a small 8-bit microcontroller. Use assembly. Don't go for x86 either-I pity Intel for the monster they have created. Freescale's S08 core is a nice starter-you can get a programmer for ~ $30. The reason this is better: They get to build a circuit that has a function. No matter how simple the circuit is, it is built to fulfill a specific function that they can understand. The microcontroller code can is programmed to make the circuit behave in different ways. The reason this is more fun that high-level programming for a 12-year old: At this stage in life, they want to become in control. Hoping that your event handler ends up being called is not being in control. Wondering what on earth the computer is actually doing when you give it a command is not being in control either.
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.
I would recommend the Unity3D dev environment, why?
It's free, it's easy, use either javascript or mono, it comes with a lot of examples / tutorials.
but most importantly, it is very quick at making pretty 3D games, using one of the examples he can be coding his own super-mega laser gun to use against robots in the fps, for a 12 year old seeing this direct cause an effect, and taking control of a game like that, is a powerful incentive.
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.
I really think that Python is one of the most elegant languages out there for teaching (and for general use). It also has the added benefit of being able to teach several different programming styles simply as it intuitively combines functional programming, iterative programing, and object oriented techniques. It also has a large, active community supporting it and would allow your brother to do something cool pretty quickly. The downfall of starting with a language like that is that other languages will seem very clunky and difficult.
That being said, I do think there is something to be said for learning a language like smalltalk. Possibly not as the first language, and not as a language for general use. But it does teach a completely different way of thinking about how to program. I think that the introducing different ways of thinking to a young programmer is really important. Otherwise it can be much more difficult to grasp those concepts once you have stuck to programming style for a long period of time. Trying to teach myself OO techniques after learning C, or rather C++ without OO, was a complicated process.
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
I did C++ at the age of 11 or 12, such as your brother. I took interest in a book my father had brought home - it had the title "101 C++ examples" but the author slips my mind. It helped a lot in the first year of university - the very first course there was nothing new to me. However, beware, nowadays C++ is all about templates, you're probably better off with pure C.
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.
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).
What about Alice? It goes all the way from simple movies with 3D objects to basic games.
www.alice.org
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.
While I was working at a school I used this program Autohotkey to successfully teach a 10 year old the very basics of programming (emphasis on very), it involves all the basic principles of teaching a computer but in a very simple and easy way and with simple and easy to understand results and uses in everyday computer use.
Meaby too childish, but perfect for a first young step!
http://scratch.mit.edu/
http://www.alice.org/
isn't that one of the best starting points to teach object orientation, concepts etc, first?
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
Having been in this path of teaching others (youngers) programming a few times already,
I recommend Python in the generic case, hands down; unless you have concrete reasons for else.
Also, this document has interesting arguments in relation to why it can/has worked in practice:
"""
How applicable is Python as first computer language for teaching programming in a pre-university educational environment, from a teacher's point of view?
"""
http://arxiv.org/abs/0809.1437
In short, Python has much of C's structure and more, without the obstacles for a beginner.
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.
to a certain extent the same way you would teach an adult, except remember the younger they are they are the easier it is for them to learn and the steeper the learning curve they can take. if your family ends up with another baby have someone in the family read serious programming and other books to them as lullabies and have foreign language tapes and other audio learning material playing at a quiet but discernible volume 24/7 around their crib, heck get rid of all your tv's and have that stuff playing 24/7 in your house and you'll soon start to notice your family's brain cells working on something besides advertising jingles and celebrity stalking "news" reports.
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.
why not bash? it's easy to see the results and will give you a good lead in to python...
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.
http://alice.org/
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.
How about TCL? Very readable syntax, no whitespace use, cross-platform, and a ton of ready-made widgets to give him some quick GUIs that might keep his attention.
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
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.
I've fallen off your lawn, and I can't get up.
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.
I've been teaching elementary and middle school kids game programming since 2003. It is a great introduction to programming and the kids love it. Trying to teach a command line interface language to a 12 year old will get boring. They need to see their goals. Check out www.tektoma.com. Teaches kids game programming through video tutorials.
Is he into robots then how about lego mindstorms NXT, simple graphic interface to get the basic ideas of programming and then can lead up to other languages to do more.
...how to teach my 40+ year old coworkers how to program.
Scratch (by MIT, http://scratch.mit.edu) teaches the basic concepts of programming in an easy way without going into specifics of traditional languages. It even has easy to use external controllers available.
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.
http://www.htdp.org/
My 12 year old has done amazingly well over the past few months with C#. Like most kids he's most excited about games, so the Microsoft XNA framework has been perfect - and of course the MS C# Express Edition is free and a decent environment to learn to work in. The XNA site has a variety of tutorials that we have worked our way through. He obviously needed some help from me with explanations of various concepts and explanations of OO concepts and I do sometimes help if he gets stuck debugging, but it is amazing how quickly he picked it up and was creating original creations. At this point he's really teaching himself as he sets himself new challenges and figures them out himself. He's really excited about the fact that he can run his programs on the XBox 360. We did buy a C# book but he generally utilizes various online sites when he needs to look up how to do something. I should note that he had previously done a fair amount with HTML and Javascript using an online tutorial site (again, mostly teaching himself with help from me when he gets stuck or doesn't understand a concept) although this is much more satisfying.
-- Dijkstra
I started using Game Maker when I was 12, but now it just sucks.
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
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.
LOGO is easy to learn with - they have versions for just about every OS out there.
BASIC is the old standby - I learned with PET BASIC, then APPLE BASIC - I'd get an Apple ][ emulator, and have at it... On the lighter side, there's a ton of kick ass games that run on the Apple ][ - sure they don't compare to the FPS, but hey - when you can play Temple of Apshai or Miner 2049'er or Karateka, what else do you need?
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.
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
I agree with all the "it must be fun" comments. So what about Alice (http://www.alice.org/) or other similar (game oriented) programming environments? After that if he's still interested he should probably attempt to learn another language on his own with you as a resource to point him in the right direction. This will be yet another useful skill for learning other languages and/or skills.
You might look into the Parallax robot kits you can build and program in PBASIC. The books are really easy to read, the program itself is very simple but you won't learn any OOP or other modern programming style. The kits are a bit pricey for my taste but they are used in many school districts. Check out the BOE-BOT kit.
Javascript -- plain and simple; java/c++ like syntax... can be written procedurally then addapted in to OO as he learns... and you can do some neat stuff (bouncing ball demo etc) with relative ease. Also it is ofcourse free and can be written on any computer without having to download and install compilers etc.
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
Your first programming language is much like your first young lady. It can either set the stage for wonderful things to come or can wreck you for all others. All kidding aside, learning programming isn't about the languages. Its about understanding programmatic thinking, problem solving, and conveying a solution is a manner that is both efficient and easily understood by others that will eventually need to read your code. There are two schools of programming thought. 1) Imperative programming languages like C, C++, C# and the like. Of these C is the best place to start. Mastery of it will teach you all the basic skills necessary to master all other Imperative languages. 2) Functional programming languages, like Lisp, Schema, et 'al. Of these Scheme is the best place to start. Mastery of it will insure you have all the skills necessary to learn any other functional programming language.
Most people start with an imperative language. In many ways they are easier for beginners. Most developers find that they never need to learn a functional language because they can stay employed without learning one. This is unfortunately, a developer isn't truly complete until they have mastered a pure functional language, despite the fact that they may never program commercially in one.
I've been programming commercially for 25 years and have been lucky enough to develop programs in dozens of different languages over the years. In my humble opinion: First C, second Scheme...... After that you'll be able to throw together some of the best software in the world with tea leaves or whatever else your forced to, if you have to, just keep in mind its all about how you put it together not the language your using.
Lua with a just-in-time compiler like LuaJIT is considerably faster than the typical JavaScript implementation. In some (naive) cases, the code generated by LuaJIT is faster than what comes out of gcc.
"I'd love to get low-level with him"
Is this the new "smackdown"?
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.
He will need somewhere to run any web code (either locally or on a hosted site) vrs a standalone language like basic or .net which can be ran locally. Well you can run html locally but it is hard to show it off to your buddies or remote family members. If he is interested, I suggest getting a hosted site (free or otherwise) and getting him to work on stuff he can show off to friends.
I suggest PHP, as you can mix html code, and it can be used to read/write flat files as well as a DB like MySQL for data storage.
Good luck regardless of what you do, as we could use another budding programmer in the US.
Joe
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'd love to teach him how to program" ... "Lead him down a path" ... What the hell is your problem? It's a human being, not a parakeet. He's not a plaything to amuse yourself with or a piece of clay to mold however is most entertaining for you.
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.
If you teach him Python, PHP or Java first, you can bet he will never learn any lower-level programming language. I think the absolute best is to teach assembler, then C and after that C++ or any other OO language, maybe Python. Even better would be to first make him program with e.g. debug.exe. Why? Because this way he will understand why we use symbols in assembler. After a while, he will feel that he has to repeat a lot of idioms in assembler (conditionals and loops for example). Then he will appreciate C. After an unimaginable number of times he will have to write something like "ret = some_function(); if (ret != 0) { printf("Error message\n"); return -1; }" he will appreciate exceptions in C++ or Python. If he will also read some good C code, he will learn that it is a good practice to encapsulate data. Again, he will be happy for C++/Python objects and namespaces, plus templates and inheritance are good for avoiding code duplication.
This is certainly a very long way to learn programming, but I am sure it is the right way. Your brother would appreciate and understand the way things are in modern OO languages. He would also have an idea of how the compiler might translate his C code into assembler, and thus, how to write efficient code. It certainly isn't the easiest way, but I can guarantee you that it would make him a good programmer. The alternative, easy way, of learning him a higher level language first would in my opinion lead to bad programming practices.
Anyway, this is roughly the way I learned how to program. I went from 8080 assembly (hand translated into hex code) and moved to QBasic and then C, C++ and Python. When I only knew C and was reading Bjarne Stroustrup's book on C++ I immediately recognized the flaws that C had and C++ fixed.
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.
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.
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?
If you want to go low level, consider providing some basic knowledge about computer architecture first. For example with a very simple architecture and its assembly language (emulator). However, as already suggested, robotics may be more attractive to youngsters.
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/
first, pick some tasks and write pseudo-programs of only comments. second, try some some c and lisp or prolog on a toy-program he has an interest in, and continue with comments and stubs. get him a primer on agile programming even though he is working alone.
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.
Strong typing is to programming what grammar and spelling are to creative writing. Which is to say they take all the fun out of it and turn it into a chore. They can only be appreciated with the benefit of experience.
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]
---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.
Lego ->
Lego Mindstorms ->
Delphi 3 ->
Java ->
C and other "more basic" languages.
In the Delphi stage I spent most of my time designing GUI's with the nice GUI designer that comes with Delphi. I then realized that each GUI element has properties (and other stuff) and that kind of introduced me to classes (Java). Java took me a while to learn but it was worth it. After Java I taught myself more basic, or older languages although I don't often use them.
So I suggest going from Visuals to text only Programming.
Before you dive into anything majorly complicated, maybe give Scratch a try. You can download it at scratch.mit.edu. It has a very kid friendly interface, and to program you snap blocks together to form code. I started using Scratch at about 12 and it really helped me understand some of the coding concepts, and I am now moving on to C#, and I'll tell you it is easier because I started by using Scratch.
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 think Processing (processing.org) is worth a look.
It is an easy step from Processing to Java, it is a brilliant way to learn to look at the ways to make raw data understandable, and is inherently graphical.
Dave
Shoes (a Ruby environment) is a great concept. If only the great why hadn't left it behind in its current messy state. Here's a short article about Shoes and two more programming environments for kids.
Captcha: kinder
Just may be finding a way to get him interested in programming. Find something the kid likes and (if applicable) relate it to programming. If the kid's personality has developed enough to where you can tell if he's an Introvert or Extravert it may make it easier on you. Introverted personality types (such as INTJ or INTP) tend to have the interest in subjects like programming which may drive them to excel at it.
Basic is quick and easy, and its Turing complete. Some might now start to say ...but it can't... and I reply: AND ITS TURING COMPLETE! Easy to learn, quick enough to code, immediate feedback, gets you up and running fast. Even if you haven't coded in a while, you can prototype in a language like BASIC debug fast, and then recode in a lower level language like C. You keep learning during the transition. Toss in libraries and modules and suddenly you have apps that you can publish. KEWEL!
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.
Whatever you do, please don't start the poor kid using a text editor. That is just a plain stupid way to turn someone off from programming. Real story - I took COBOL programming language course at our community college in my senior year of high school. I loved the portion of making logical flow. But the environment so turned me off I stayed away from the next 21 years.
The stupid instructor could tell that I had potential. But in his stupid way of showing superiority he insisted that I spend the semester writing code with an editor that made edlin look user friendly.
The point is to use an environment that relieves as much of the syntax burden as possible. If the IDE lets him know that something is right (or wrong) that is a good thing. And if it supports syntax completion that is a good thing. If this sounds like big bucks, then download Visual Studio Express with either C# or visual basic. Let the new person focus on making something that does stuff before introducing the brass knuckles, I can suffer through this crap that many programmers love.
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.
Try the Boe-bot from Parallax with the pBASIC language ($150). And the rugrat will see the code actually doo stuff, blinky lights, bump into walls with touch sensors, avoid objects with IR and cool stuff like that. Or try the LEGO NXT ($250), very cool also. The NXT G programming language is fairly easy learn and fun to work with. Great for you and the little tike and it LEGO's so he/she can rebuild into another configuration. No blinky lights but you do have sound, sonar, touch and light sensors.
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.
My first languages were LOGO, BASIC (Atari, C-64, GW-BASIC), and I moved on to C and many others.
What's important is exposure to /ideas/ about computing. I would first, of course, see if he's even interested at all. Then, try several different languages and see what he likes.
There are systems designed specifically for teaching, such as LOGO, Alice, and others. You can get "modern" LOGO systems. Try an ALGOL-based language, like Pascal. ... you get the idea. :)
Try an Object-Oriented language, like Simula or Smalltalk. Try
My point is, essentially, that he won't be programming for a living for a long while, if ever. It's much more important to understand what can be done with computers, and how,
then to worry about any particular language. If he's destined to be a geek/nerd/whatever, he'll do a lot on his own. Commercially "hot" languages change with great frequency,
so don't worry about that too much.
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
Teaching someone program, and teaching someone to program well (logically-organized code, readable code, maintainable code, etc.) are two different things.
How many write-once, correctly-modify-never Excel macros exist in the world?
I don't believe kid-failure at Legos, etc., means they won't be able to program; not all kids are that coordinated, or that interested in physical media (I liked Tinkertoys and Legos, but I wasn't bug-nuts about them; they were simply toys).
I'd recommend starting with LOGO, then going to Pascal, then something SmallTalk-like.
The point is to teach the concepts, combined with reaonably fun feedback, and not overload the kid with needless detail. This way, the kid can extrapolate and also ignore things as needed.
Noobies can drown in GW-BASIC, Perl, and Java. If you wanna kill his brain, get him started on MFC and ATL.
http://www.alice.org/
That's commonly used as a starting point. It's Java, but not as we know it.
As a teacher, I found simple problem solving steps should be taught first before moving to powerful languages. the concept of sequence, selection and loop and applying that knowledge to several of his home work should be taught.BASIC is the simplest way to start those problem solving steps. As a bonus he can move to VB(even if we may not like) which uses BASIC under the hood. If he survives, moving to C will be easy in six steps to take care of the sequence, selection and loop. If he continues show interest he can take whatever language classes are given at his school. Adults way of learning programming is different from those of children. Their decision making ability from the frontal lobe does not mature quickly to teach them all details about programming. Very carefully if you teach a child rest will be easy. Don't think what language use now. Languages change based on applications.
Why not try Scratch? You can get it at
http://scratch.mit.edu/
It's promoted by the ACM
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.
Try out http://www.funsciencewithyourcomputer.org
It's for teenagers. The programs are useful and original, with step by step instructions to modify them. It uses Java and Eclipse.
Scratch. http://scratch.mit.edu/
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 ?
You just screw all this software languages and do some hardcore hdls and play with fpgas all day
PICkit2 Debug Express comes with everything(IDE,Writer,Board with headers) for just $50. It lets you learn every basics you need. I think that topmost-layer things, like python with GUI, is too much complicated to master for a boy in 12.
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 started off with GW-Basic.
I know we slash-dotters to some extent dislike M$. But they have something just to address this issue. They call it the "Small Basic"
http://msdn.microsoft.com/en-us/devlabs/cc950524.aspx
Syntaxes are pretty similar to C# style. Overall, not bad. Good documentation too. I managed to get my little sister hands on with programming using Small Basic.
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.
You might want to check out this:
http://en.wikipedia.org/wiki/Hackety_Hack
It is a Ruby environment aimed at the beginners, specially teens, with tutorials and such.
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?
I learned to program before I was 12, but I was really interested in web development, so I started with Visual Basic (for ASP) and PHP. I'd say see what they're interested in, and teach to that!
hmm, if he is 12 I think I would start with Actionscript 3. That is not a real programming language but the best tool to learn the basic principals of OO programming and in the same time it is fun for a 12 yer old. He can get visual results really fast. In a month he can start making games, there is a couple of extensive 3D library where he can understand the basics of 3D. There is also a sense of framwork and SDK-s. Use text editor and CLI so he understands the idea of toolchain. The syntax is ECMA which is C like enough so later most of the language syntaxes will be familliar. He can make desktop applications with AIR, learn about SQL databases, filesystems. And there is a clear path towards web development, java, javascript, databases etc
I'm not sure about a 12 year old - and it depends on how adept they are at mathematics - but I'm teaching my 16 year old bro.-in-law right now. We spend ~4 hours/week and have been doing so for the past several months. We started out by learning binary and how to count in binary, add, subtract, etc. Then boolean logic (logical and, or, not, nand, xor) using the proper CS terms and symbols. Then we moved on to studying computer architecture and hardware (how CPUs work - registers, program counter, etc., how memory works, how hard drives work, etc.). Then a simple introduction to assembly - load, store, add, jmp, etc. and how they're encoded into instructions the CPU uses. We wrote many programs in pure assembly. And then we moved into higher level ideas such as while loops and if-then branching constructs and then pointers. We then practiced hand-creating the assembly from the high-level while/if/switch statements. Having the assembly background made things a lot easier to understand. It was pretty easy to explain what a compiler is and how it works after that. Then we moved into discussing procedural programming (pointer arithmetic, scalar data types such as int, float, double, short, char, etc.) in C. Then object-oriented programming: inheritance, polymorphism, encapsulation, etc. And we're using Java for that. At this point we're just getting comfortable with OOP techniques and making meaningful programs. But we've discussed arrays, objects, linked lists, stacks, queues, hashtables, bubble sort, merge sort, linear search, and binary search.
I've found that taking a CS approach really helps to understand the big picture and provides insight into why things are done the way they are.
There is this language called Alice, I haven't tried it, but it got a captivating interface that would definitely catch the interest of kids and can really help to introduce him to proper object oriented programming and stuff in a nice interesting way... I read that they are using it in some universities to encourage female-students to take programming courses since they probably are not inclined towards programming...
Try the processing language at processing.org
This is by far the easiest way to pick up basics. It uses java language as a base, but leans more towards visualisations, graphics, interactions and sound.
You can write an arcade-style game in this using little more than imagination and simple code. The forum is active, books (with pictures) have been written to help along,
it's open source, there are libraries for all the 'cool' stuff that's out there at the moment. It has a related project called mobile processing to write mobile apps,
another related project for electronic hardware apps called arduino - all of these are used a lot in Sweden to teach high school and entry level programming.
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.
If you decide in favor of Java, definitely try http://robocode.sourceforge.net/ - idea is that you have to program a tank. It will drive, shoot, scan for opponents etc.... There is even lighter API for junior programmers. :)
This is very fun, even for adult programmers
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.
Provided that he is actually interested in programming, basically any language with visible results will do, as long as it's not too simple or restrictive.
Lego Robotics would be a good idea. Robots are fun. Although I as a kid hated the puzzle block style of scripting in Lego Mindstorms.
Things like Pygame and gamemaker are also a good choice, maybe even flash if you have the bucks for it.
Things like HTML are not really programming, but it does teach how a computer requires very specific instructions and coupled with javascript it is very easy to see results and it's easy to learn.
Another interesting thing is Second Life. In there you can create objects out of primitive shapes and have them move, change appearance, follow their owner, talk, all kinds of things. I've seen some pretty amazing stuff there. It uses LSL which is an event based language and is a bit similar to javascript and quite easy to learn.
"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." - by sopssa (1498795) * on Sunday December 27, @02:48PM (#30564852)
Agreed, 110%, on Borland Delphi (and, on ALL accounts noted in your quote above)... & you are COMPLETELY CORRECT on interest: If someone does NOT have it? They'll never be "driven" to excel @ it, or to get any good @ it.
APK
P.S.=> I have been programming personal computers since 1994 professionally (& midrange - mainframe units for years before that in the mid to late 1980's to the early 1990's professionally & academically as well), & fairly "fluently" in:
1.) C
2.) C++
3.) VB.NET
4.) ASP.NET
5.) VB 3.0 - 6.0 (16/32-bit)
6.) Pascal (Turbo, or Delphi)
7.) JAVA
8.) X86 Assembly (via MASM usually)
9.) SQL (in DB oriented tools like Access or in the other RAD tools I use to talk to DB engines like ORACLE, DB/2, & SQLServer)
10.) COBOL
11.) Fortran
12.) DOS Batch & WSH/Powershell scripting
And, to this very day? I'll say the SAME THING as you did quoted above about Delphi, vs. the others!
Especially since Delphi "piqued my interest" as far back as 1996-1997 (after I had programmed in 16-bit Delphi 1.0 on Win3.x) in 32-bit in the Sept.-Oct. 1997 issue of "Visual Basic Programmer's Journal" entitled "Inside the VB5 Compiler".
There, that competing language's trade magazine had a competition between VB5 (with its new watered-down MSVC++ 5.x compiler engine), MSVC++ 6.x, & Borland Delphi 2.0? Well...
That's where Delphi ABSOLUTELY "SWEPT THE FLOOR" with BOTH VB &/or MSVC++ in performance of the code generated, & by 2-3x or more in MATH & STRINGS WORK (which every program does, mind you), & won 4-7 tests (downplayed though this fact was, you could not hide it on the bar charts generated & the editors tended to downplay this only noting it in 1 line of a 5++ page article there no less).
(Especially since its projects in Windows are pretty easily "ported instantly" to Linux also, via Kylix (Delphi for Linux), if you avoid diff.'s between Linux & Win32, such as drive letters vs. mounted devices + some of the diff.'s in socket programming between Linux &/or Win32)... apk
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/
It doesn't really start out as programming, with it's drag and drop 'actions', but teaches programming perfectly. What's more; it's fun, and you see directly what you're doing (creating epic games without too much hassle). Later on, he can use the programming language of Game Maker, GML, which is loosely based on C++.
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.
There is nothing wrong with Pascal. Get him Lazarus or a free Delphi (if you can find it anywhere which is unlikely). He can then start writing some simple UI stuff without getting too frustrated. And it allows him to get into the itty gritty low level (meaning Windows or Linux api) stuff as well. If he likes it and understands the concepts, he will find the programming language of his choice faster than you can say JavaScript.
I suggest looking into Scratch (http://scratch.mit.edu/). It's a fine graphical programming environment developed for precisely this purpose. Each control structure is given a graphical "shape" with "connectors" on each end to show how individual structure work as well as showing how each structure interacts with those around it. Give it a review!
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.
BASH/Command Prompt -> LOGO -> HTML -> BASIC -> Pascal(Delphi) -> Assembler -> C -> Java
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*
find a game called colobot, it's fun and it teaches a c "style" language.
Hi,
I'm not sure if this environment is more suitable for girls than boys. I believe Alice was specifically designed to get girls interested in programming. Having said that the fact that you can drag and drop objects into your environment and then animate them with C/C++/Java like syntax is interesting. The last time I looked at Alice http://www.alice.org they were taking about a deal with EA Games to allow the Sims animation engine to work with Alice which would be really cool.
On the regular language front I learned to program in Basic via punch cards in the early 70's when I was 12 so absolutely no harm in trying Basic. Another good alternative is Logo. Or for physical feedback of what you are programming there is nothing better than Lego Mindstorms.
Good luck.
Fergal Dearle :-)
http://www.dearle.com
I'm not an anonymous coward. I just did not bother loging in before commenting
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.
I started programming Visual Basic (acctually vba) and html when I was 10.
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.
Read the camel book and have some fun.
Employee Of the Month - Cyberdyne Systems Corporation - September 1997
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'll have to start from scratch. Find an isolated basement or a garage...
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!
COBOL!! Great future for invividuals to fall back on when all the glitzy jobs dry up (completely) at Wall Street. Ka-zillions of lines of code to maintain, always have a job from the world's biggest, best, deepest-lined pockets. So obvious that I'm surprised everyone else missed this easy to learn, and high-paying, route!
The instant gratification part is the really important bit if you want to keep his interest up.
That is part of the problem with children today. They want instant gratification and are unwilling to put forth the effort and time necessary to learn proper practices. If BASIC was good enough for me, it sure as Hell is good enough for the children of today. Most of the IT people I have worked with during the last decade cannot programme something as trivial as "Hello, World!" in any language.
With the right book a competent person can learn the fundamentals of programming in the C language. After programming in Commodore BASIC and 6502 Assembly Language, using pokes and peeks initially, I moved on a teach myself FORTRAN and C. The "C Programming Guide, 2nd Edition" written by Jack J. Purdum still has a place on my bookshelf after more than 20 years.
Nice and easy to get some moving things onscreen, free, skills easily applied to other C-like languages later.
Scratch 2D http://scratch.mit.edu/ & Alice 3D http://www.alice.org/
Pleos - http://www.pleoworld.com/Home.aspx
http://csunplugged.org - teach without a computer, such as counting binary on your fingers
I'd recommend Python. It has the features of most languages and it's a good introduction to general programming concepts. Best to start with a book. Head First Programming has just come out and I believe that uses Python as the teachine language.
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!
I think you should see if any ideas peak his curiousity and then think of the easiest way to write that code...
The earliest programs I wrote were just simple things on my graphing calculator b/c I had it with me all the time, could give them to friends, etc.
I also think ruby isn't a bad first step since you can do O-O or scripting, and it is not very cryptic! They also have a nice little web based gui to introduce you to ruby.
Eventually you could either switch to C or embed some C code in the ruby, to show how to get to a lower level of abstraction
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.
This is a pretty neat tool for a new programmer:
http://smallbasic.com/
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.
awk is pre-installed on unix boxen, has all the standard loops and operators , is easy to use.
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.
If he is interested in programming, I would recommend getting a copy of Dreamweaver (you can get last years version for next to nothing on e-bay) and get him started learning HTML and CSS. Creating something that he can show off will be a great motivator.
If he is NOT interested in programming, I would recommend starting with Scratch (scratch.mit.edu). It's an OOP that is designed to create games and simple apps, but you can add structured code to it to create more sophisticated apps. They have a public area where you can share apps that you have created. I started my son on it when he was 10 and he still uses it.
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.
http://scratch.mit.edu/
Scratch is designed to help young people (ages 8 and up) develop 21st century learning skills. As they create and share Scratch projects, young people learn important mathematical and computational ideas, while also learning to think creatively, reason systematically, and work collaboratively.
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.
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/
Software development begins with the question "Is there a problem?", and proceeds given an affirmative answer. Does you brother want to learn to program? If yes, then "Why?" "To solve what problem?" "To satisfy what creative urge?" At age 12, he may not have answers that suggest C coding, thus providing you with a reason to show him your C programming skills. Perhaps you could show him how he can gain a greater degree of control over the program he uses most. This might be a game, or the text editor he uses. It may be that the most appropriate language with which to start is the one embedded in his application of choice, which might lead you down a path such as Word Basic, Visual Basic for Applications, Visual Basic, then C++. On the other hand, he might enjoy a blank editor screen, a simple problem, and the process of figuring out how to make the computer do what it must to present the correct solution. His call. Your mission. It's great that you're willing to be of service.
Ruby. Chris Pine has a nice site that helped my son start. Short tutorials that gave instant results to maintain interest.
http://pine.fm/LearnToProgram/
MIT makes a programming environment called Scratch that is designed to introduce kids to programming (http://scratch.mit.edu/). There are a few things Iike about scratch as an introduction to programming:
1. First scratch is designed around 2-D graphics (game style) programming. You start with a background that you can add sprites (characters) to. Each of the characters comes with a set of built in commands. You can build you own scripts for each character. It is easy to get started quickly in scratch and see the results. More satisfying in my opinion than "hello world" or text based programs.
2. In scratch you build programs from graphical building blocks which you drag onto a script window. For example, a loop command looks like a c clamp into which you can drag other commands. Syntactic errors are not possible, so the focus becomes programming structure. I think there is an advantage to learning how organize commands to do what you want, and learning the value of different programming structures before having to deal with finding syntactic errors, since these can be quite frustrating when you are just starting.
3. Several important programming constructs are available such as if statements and loops. Generating and listening for event is supported. You can write fairly sophisticated programs with Scratch.
I think Scratch is a good way to help kids feel successful quickly, and has interesting things to keep their attention. It also has enough 'programming structure' to teach them several useful programming techniques that carry to many languages. Another option is the programming environment 'alice' (http://www.alice.org/). This is a 3-D graphical environment for programming. I found this to be more complex to teach my kids. Alice also uses graphical drag and drop programming. The characters (objects) in alice 2.0 have less high level functionality built in that scratch and it required a lot more work to get a simple interesting programming running. There is a version called 'story telling alice' that you can download that has more built in functionality for the characters. I liked this much better than alice 2.0, but it is still harder to teach than scratch. I had to give up on story telling alice because of stability problem on my vista machine. Alice 3.0 is under development, and adds more interesting behavior to several characters. However, last I checked it was in alpha stage and also had various stability issues. Note that you can download characters for alice 2.0 that have more functionality from the wiki (ones that people have contributed).
HTML, to JavaScript, to ActionScript/Flex
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!
I started teaching myself how to program when I was 9. Unfortunately, the only books on programming languages I found in the school library back then were BASIC. Whatever you do, start the 12 year old off with something good. Like C, or at least C++. In the order of Data Types, Console I/O, then math operations (plenty of toy programs can be created from the above three).
Then, if statements, loops, and if they're following well, file I/O.
IF they're still into it, get to the good stuff like pointers, data structures, methods, pass by ref/val, function pointers, etc.
I wish this was the way I learned, I would have done much better in college instead of relying on the really bad habits I picked up using M$ QuickBasic45. Ugh! Goto! SUBS and FUNCTIONS on entirely different screens with no real passing management, bleh!
I recommend looking into Kodu, a visual programming environment from Microsoft Research tailored for game development (disclaimer, I'm a dev on the Kodu team). Kodu uses a visual programming language, and is a very gentle introduction to progamming using only the xbox controller for input. It's free for the PC, and a $5 download from the Indie Games Channel on Xbox. Here's the project page: http://research.microsoft.com/en-us/projects/kodu/
I am learning programming myself right now, and we use Ceebots. I find it to be fun, intuitive and (hopefully) a good teacher for when I get into real C.
http://www.ceebot.com/ceebot/index-e.php
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.
Link to this website: http://openbookproject.net/thinkcs/python/english2e/
I honestly think that Pascal is the best first language because of the way it enforces the concept of datatypes. If you dive into C as the first language, the concept of pointers and all that might be a bit unclear, with Pascal it's pretty explicit because it won't let you point to any other datatypes. It creates a good habit. I would just make sure to have him move on relatively soon to OOP though.
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.)
Try Alice - http://www.alice.org - it has everything from loops to objects to object and class interactions, all within the premises of making animation movies.
I would start him off on Python. No, it's NOT a snake... :-)
I was wearing my PyCon t-shirt, when some moron asked me if it was a herpetologist conference!!!
Python has the purest and simplest syntax possible, although you DO have to pay attention to indentations.
It runs on just about every platform, highly interactive, uses same basic function names as C and other languages. No complex "make files"
to make or deal with, and it glues to just about everything. Its free "python.org". It's Object Oriented...
From there, you can go anywhere. Client side applications are usually programmed in C or lower level compiler related languages,
where Server side software (WEB, CGIs, etc) are written in PERL, python, or PHP, or Java.
J
J
At 12 I was learning assembly and found it the most fasinating language, it is raw, powerful and unresticted. However I'd show my children C# as a very good starting language simply because it is very easy to get something interesting up and running fast.
Write an internet filtering system that blocks porn and install it on his comp. He'll learn programming to hack around it in no time.
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.
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.
Just teach him QBasic, it is nice, easy and fun language, it is straight with graphic and sound, and it doesn't need to compile to run programs.
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.
assembler :P
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.
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.
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.
Not a troll, I'm completely serious.
Nobody told me how to meet girls, how to date them, or anything else. Like most Slashdotters, remaining a virgin until my 20s is a fact that has scarred me for life.
I know people - even people who are very much of the "Slashdot type" - who were having sex at age 14. I didn't get laid until 11 years later. And it now pisses me off that I was so led and allowed to follow the path of geekiness at the expense of love and sex.
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!!
http://www.amazon.com/Squeak-Programming-Robots-Technology-Action/dp/1590594916
check this book out. its a great book, and tons of fun
scratch programming (http://scratch.mit.edu/)
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.