Posted
by
timothyon Sunday December 27, 2009 @03:48PM
from the hypnotherapy-might-work dept.

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 [python.org]. 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.

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. [inventwithpython.com] 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.

Because Python is more popular, isn't tied to a proprietary vendor's toolchain and runtime, has various modern features that make it rather powerful, has a wide selection of standard and third party libraries, and can interoperate C or C++ as needed later on.

There's actually an interesting Agent-Based Simulation system based (loosely) on Logo called NetLogo (http://ccl.northwestern.edu/netlogo/ [northwestern.edu]). You can do basic Logo stuff, but it can actually do some very sophisticated modeling and the syntax is not very difficult.

Using syntax similar to Logo, you have program agents to sense their environment and then take action based on that. The concepts scale well to other platforms like the Lego Mindstorms.

Followup to my last post: another suggestion in asm-type space (if you don't want to start with electronics) is to download a corewars emulator (or perhaps a similar Robowars type game) and beat each other up in core/logic space for a while. I remember a real "aha" when I learned about Imps, Dwarves, and self-modifying code in general that way.

I've been fortunate enough to mentor a couple of prodigies. The key is not to Go Big, or Go Small, or Go Bare Metal, it is to go where their interest lies. If they really want to know about electron migration through a solid state material, Hell, go for it. But if they are interested in how to generate a web page, that's where you start.

If they get hooked and you start to work together on really interesting problems, you will eventually get into all of the classic core problems of program development: design, platform choice, networking, deployment, security -- you'll get to all of these eventually.

My vote for a first language is Python. I also suggest starting with Guido van Robot [sourceforge.net] as an interesting starting point. Even older kids will understand that this is just a starting point and they may zip through the problems in a matter of days or even hours. You will encounter limitations in terms of functions, looping, etc., but that can be a springboard to how you do it in real Python.

Woah, skipping a few steps, are we? I hope he built an ALU and then a microprocessor before that!

You jest, but (also in answer to other replies) I was more suggesting interesting parallel tracks rather than something proscriptive - a 12-year old can get it. If your 12-year old likes learning things by reading, a really really good resource is A.K. Dewdney's Turing Omnibus - a non-major comp-101 level text that's really REALLY good at describing everything from electrons and bare metal to theory and practical coding. Puzzle-oriented and v. accessible to pre-high school nerds.

You may actually want to be a little wary of languages like Python if you plan on teaching a kid C. It's a trap that I, as a young programmer, fell into with classic Visual Basic: the language is just enough that you get hooked on it and don't want to move on to something else. That's an important reason, at least in my book, why starter languages should be limited in their capabilities—that, and it makes a great learning experience for the kid to come back and complete his or her favourite language l

My first language was BASIC on a Commodore 64. After that was Fortran and then eventually C and C++ on Windows, and then C and then C++ on Linux.

BASIC was a good stepping stone, but I really wish I would have started with Fortran as it was much easier to learn concepts with. I found the peek/poke memory concepts of the commodore 64 very frustrating.

But if you are just trying to build interest, rather than solve a problem, I suggest javascript as you can build on an existing familiarity with web pages to interactive slide shows, quiz games, etc.

This seems to me like a good idea in theory, but a poor one in practice. I like javascript as a language, and have written a couple of reasonably nontrivial apps in it. However, a beginner is going to need a book that's designed to teach programming using a particular language. I don't think there is an approp

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.

I typed pages and pages and pages of code I didn't understand. And when my "A" shaped man wouldn't climb up the italic "I" ladder, I got really pissed off. Radio controlled cars were much more fun.

15 years after that, when my first child was born, I had a ton of staying-in time and I started to learn Java. But that was boring and didn't do anything I wanted it to do.

HTML and Javascript was next. I got <breally</b> good at that.

So get him a decent radio controlled car, tell him to wait 15 years, get married, have a child of his own, then write silly Greasemonkey scripts all night. There's so much fun to be had from auto-submitting forms.

Great advice! I also tried to teach my son to program, but he wasn't interested. I think the 'key' is to find something he is interested in that he has to learn to program to do it. Robotics comes to mind. My first language was also basic. My first program was a simple program go plot quadratic equations on graph paper for extra credit in calculus class. My second program was a program to hack passwords because I didn't have high enough priority to run things on the computer. I had a 'reason' to code beyond learning. I learned to code to solve a problem.

Use the project to select the language, not the other way around. I too tried C++, but because my first program was a Windows GUI, it was hopeless. I then took an online class that focused on more batch-oriented homework, and it was a breeze. Use something that can have lots of small successes instead of one huge result. It's easier to cope with a small setback than a large one, and he will be less likely to get discouraged once he can start growing his skill set and see that growth.

Start with the simple stuff... basic syntax and if/then/else type logic. Then add some methods or functions. Toss in some for/while loops. Build a solid base that can be used going forward before you get into heavy stuff like operator overloading or inheritance. Syntax first, learn how to compile or run, learn how to debug simple errors. Then move on to more advanced concepts.

And for gods sake, find something that he doesn't need to worry about libraries or a debugger to figure it out. Show him how to use printf statements to trace and debug programs FIRST before introducing him to debuggers.

Great advice! I also tried to teach my son to program, but he wasn't interested. I think the 'key' is to find something he is interested in that he has to learn to program to do it.

No you asshat, the 'key' is to find out what your child is interested in that they show aptitude at and nurture that. Attempting to force your child into some preconceived mold in order to enrich some deranged sense of proxy-succcess you get through your child's achievement is just wrong.

Your children do not necessarily enjoy the same things you do. Deal with it.

It's less important the content (how to program, which language) than the motivation, having the student want to learn it. When a youngster wants to learn something, they will learn more than you ever could have taught them. It's too easy for experts to not be teachers and lose the youngsters early.

If the kid wants to learn and you have the time and patience, you can never fail, one-on-one.

I agree strongly with you step-by-step approach to reaching your destination.

Expanding on that a little, the period of discovery might be over with computers and hence programming. When I was 15 my school got 4 CP/M based machines and 2 apple IIe's. It was a time wonderous discovery of new things, and to get there students did it themselves.

With all this stuff being a natural part of a kids life now, I do wonder if that desire to discover is not there so much.

Logo FTW!
I started on Logo when I was 10 or 11, at the new computer labs in my school. Then my father got us an Atari computer and we started doing basic (in between Montezuma marathons:) and... flash forward twenty-odd years, and I'm coding for a living.

it's got a C++ - style syntax,is forgiving about lots of stuff,can do graphics,can do awesome 3D if there's an interest in that,and imo best of all, it's the most portable language going: it's easy to put your nephew's apps on the intertubes they're guaranteed to run on his friends' computers with no fuss, no muss.

I hope you guys are kidding. First of all, javascript is an awful language. Secondly, I really fail to see how he would have fun in creating javascript stuff. It's a web programming language, not something a 12 year old should be using to have fun messing around and maybe trying out some 3D stuff.

C#, Delphi or Visual Basic are a lot better languages to start with, with their easy to use language, large library and a language you still get somewhat nice results with little programming. It's also a lot easier

But if they're interested in web development, doing stuff with PHP would be a lot better. You get to do a lot more meaningful things, like browser based games. Some simple games are really easy to develop using cookies and sessions, and when you need to you'll move to mysql and learn database programming along the way too. That's how I did too, because I was making fun things that needed to use databases. A 12 year old isn't going to learn database programming because he thinks it would be useful to him eve

Javascript not a great suggestion for the OP, that I can second. But an awful language? You either don't REALLY know js beyond some simple HTML even handling, or your definition of "awful" is different from mine. The more I use it as the primary programming language for dynamic, heavily web service oriented web apps, the more I like it. It's one of the most expressive and flexible languages, something completely belied by its deceptively simple syntax. Then again, that's a trait it has in common with its sy

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

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.

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.

That's the thing, and that's why I also think C is a bad programming language to start with. It doesn't have almost any build-in library, and adding (and discovering) such to your project is pain in the ass. C also doesn't let you do any kind of little errors. That is probably why you're saying that making a real-time video game requires lots of skills. It's not so with different games. You can get nice results with Delphi or Visual Basic (maybe C# too, never used it but it looks like that). You aren't maki

C# is an ECMA standard. The.NET Framework is the proprietary part, and there's Mono and DotGNU if you'd prefer more openly licensed libraries.

Also, if you've ever used C#, you know that a lot of what you learn there is applicable to Java and, to a lesser extent, other curly-braces syntax languages (and if you're really feeling up to it, you can play with pointer arithmetic using unsafe pointers and the marshalling system for P/Invoke and COM Interop). The new C# 3.5 features such as generics, anonymous met

IMHO everything is wrong with C as first language. It gives you dreadful programming style and is not a right tool for application programming. You can mod me as a troll if you want but you've got to chose the best tool for the job and C is a tool for writing operating systems for fuck's sake. It isn't even a high level language. All those buffer overflow security holes happen because of both typical "clever hack" C programming style and choice of using a language for writing operating systems to write business applications.

Pascal wasn't a very good teaching language for nothing - it forced you to write software in a very clean and readable way.

IMHO everything is wrong with C as first language. It gives you dreadful programming style and is not a right tool for application programming. You can mod me as a troll if you want but you've got to chose the best tool for the job and C is a tool for writing operating systems for fuck's sake. It isn't even a high level language. All those buffer overflow security holes happen because of both typical "clever hack" C programming style and choice of using a language for writing operating systems to write business applications.

So teach him assembler as a first language, and EVERYTHING else will look simple in comparison!

Seriously, start him with either the java console (system.out stuff) so he can do "Hello, world!", or start him with html+javascript.

Programming today isn't like when we were kids. In those days, you did whole applications with ONE technology and ONE package - dbase, clipper, turbo c, delphi, dbfast...

Now? The database is decoupled from the app logic. The app logic is decoupled from the presentation, which could be a program or a web app. We wanted separation of the storage from the logic from the front end, and we're there. The kid will get more fun doing simple web pages that he can see results in right away (important to get that positive feedback going, or he'll go back to his psp or wii or xbox or whatever). html+javascript gives him that, plus you don't need anything to start except a web browser and a text editor, - not even a web server.

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.

This is a very good point, which is why I recommend MMF [clickteam.com]. (or even TGF) I started with it - it made creating games quite simple. At the same time I learned javascript which helped for webpages. Then one day I tried making a game in javascript. The game worked, but ran like shit, because Chrome didn't exist at the time.:P Shortly after that I started learning Java/C. I settled on Java, because of its strictness. Javascript is very lax, so although the syntax looks like C, you can't do any of the same stuff i

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.

This is the answer. In starting off with pretty much any programming language, you screw around with strings, do some match, maybe make a GUI with some buttons and stuff... With PyGame, you can make games! Or at least, you can put graphics on the screen, move things around, make noises and it's easy... but not restrictive.

Logo (and programs like GameMaker and its ilk) get the first bit right, but once you want to do something that isn't moving a turtle around you're somewhat stuck. But with Python, you can do pretty much anything. And it's portable too! You can write a script in Python on your computer and run it on your phone (if you've got a Nokia, at least).

Get him a Propeller micro controller kit from Parallax Inc http://www.parallax.com/tabid/407/Default.aspx [parallax.com]
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

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 replace

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

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.

Learning programing without a specific goal, is another kind of hell. Make it about the 'Solution', then show him how to get there.

I agree with this. As well as a project that someone is interested in it may well pay off to (if this is only his first attempt at programming) give him a big book with lots of examples and questions and answers. An example of book style (please don't flame me, its the format that is good not necessarily the content) is Herbert Schildt teach your self C. This format is great be

Firstly he has to want to do it, I mean really want to because it is hard. Show him this [catb.org] its pretty inspirational (what ever you think of the author), this got me into programming. Peter Norvig says [norvig.com] 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).

Really. If he is interested in programming and you can guide him to follow the book, then he will know what to expect from a programming language, get a a good background and will not need to unlearn bad habits.

I wasn't taught how to program by someone. I discovered QBasic in DOS myself when I was 13 and was automatically drawn into it. I liked programming graphical things the most (plotting pixels with PSET). The fact that such graphical things were possible is what interested me so much. I'm not sure how this is with other people, but programming boring text examples makes it uninteresting probably.

Perl is designed to be a 'natural' language, kind of like the ones we speak. A 4 year old can speak English, and senior scientists use the same language to discuss very advanced topics. Perl is like that. He can learn it very fast and do neat things and not have to worry about the lower level constructs. But when he's ready for those, they are there. And the transition into C from that point will be very smooth.

Seriously, perl is the first language i really learned well and would be a great choice.

I would also recommend seriously just HTML and then later throw in javascript to build on that. it can lead to really fast results to catch interest and has a lot of immediate application in the trendy werb page design/myspace kind of development.

Perl, it is actually easy to learn and well documented. There are few quirks but it is easy and more powerful than other languages. One just needs to remember to start off each program with $|=1; to turn on autoflush on stdio and to remember that when doing $var=func(); the return argument will always be the last returned. A few rules but nothing really that difficult to remember.

C/C++ might be better avoided witha newcomer. It could exceed the attention span with those younger programmers. A good GUI builder which can be used in a simple manner is also a good idea. TK is relatively simple but there may be simpler toolkits to use.

To really capture interest, the programming has to be straightforward and lead to instant tangible resutls so lots of additional code and formalities and having to type lots of intitialisation and set up code, can blow them out.

For me, programming was never ever the goal in itself. Sure, it was fun experiencing building something out of more-or-less abstract logic, but it was always about what I could *do* with the program. E.g. solve practical (i.e. of immediate concern to me) problems. Of course there are other personalities - those more mathematically oriented who end up in pure CS.

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 / envi

Plain old-fashioned Basic might not be perfect, but computer programming literacy seemed much higher back in the days when every popular 8-bit personal computer came with a Basic interpreter. Nowadays, they seem to want to keep young people as mere users, until they are old enough to worship scalable software engineering practices, instead of just having fun coding a few lines of whatever.

IMHO, I think there's great value in a greater number of people learning what it is to code up a few lines of whatever,

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 o

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,

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

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 wo

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

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.

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 mode

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

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 wi

I taught my brother a bit using KPL [phrogram.com], but looks like it has been replaced with Phrogram [wikipedia.org] 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.

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

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.

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.

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!

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 .

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.

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.

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 [gnu.org]. 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.)

He'd better learn VB.Net. It's more verbose and easier for beginners to grasp, while still having the entire.NET framework underneath. If he grows to like the C syntax, great - he has C# to move to, and if goes to Linux, there's Mono. Maybe he'll like Python, so he could use IronPython...

I have personally went through a really strange cycle of programming language choices. Started with BASIC, moved to C, then to Pascal (and Delphi) and now I'm on VB.Net and heavy JavaScript:)

I would actually recommend Delphi (maybe it's.NET version) directly over Visual Basic. They're not that far away in learning curve, but Delphi is a lot better language and it's easier to move to other things later on too. And at least with Delphi's native application you can get quite close to C++ performance, while Visual Basic is a completely different case.

"if x and not y then foo" is much easier for a beginner to understand than "if x && !y foo".

Having endured some programming classes at the university with people who never had any programming experience, two things could immediately be observed as problems: people kept forgetting which symbols are used for what and few could grasp pointers (one of the reasons why C sucks for beginners).

I'd actually say that VB or VB.NET would be a horrible first language, very little code I've seen come from developers who started with VB or VB.NET has been well-written and I think this is partly because of the language and partially because within the "VB community" there is less focus on the quality of code.

To elaborate, the language has fairly quirky syntax compared to many other languages, some may not like it but I think it's better to start out with a language that has a slightly more C-like syntax,

I really hope you were being sarcastic with that. That code is not good for grammar / syntax — it has no obvious start point, comments look like unbalanced quotations, and there are subroutines that only set string values to an empty string.

[add to that my personal preference for end-of-line markers, and brackets / braces to surround statement blocks (without them, it's like sentences without commas and full stops)]

Who gives a fuck what Dijkstra says? Modern variants of BASIC are nothing like the '70's and '80's BASICs he was complaining about. A lot of programmers made and still make a good living in VB. I'll bet a significant fraction of/.ers started off in QBASIC, GW-BASIC, PowerBASIC, or VB. The rest of us probably started with the BASIC interpreters built into our "Home Computers."

You have to learn to walk before you can run. I know a lot of first-time programmers who gave up on Python as a first programming language. It's just too complex and the concepts are too abstract for a lot of people with no prior experience. And you can argue me until you're blue in the face about how you don't think it should be so, but that ain't gonna change the way it is.

Who gives a fuck what Dijkstra says? Modern variants of BASIC are nothing like the '70's and '80's BASICs he was complaining about. A lot of programmers made and still make a good living in VB.

Yeah, and VB.Net doesn't appear to be significantly easier than (say) C#, while having much clunkier- and more nonstandard- syntax. So unless you already know Visual Basic, there's no compelling argument in favour of it.

I assume that Visual Basic was originally intended for people who'd learned with old-school 8-bit BASICs, to provide an easier ramp than the sudden leap up to the likes of C++. Over the years it appears to have acquired more serious features which the people *who were already using Visual

When I was 12 decided I wanted to learn how to program. (Nobody came to me and asked, I just had my parents take me to a library and I picked up some books.) The only thing available to me was QBASIC (Version 1.0 on MS-DOS 5.0), and I taught myself by reverse engineering programming examples (I didn't really want to read the books cover to cover, and I didn't know any programmers). This was in the days before I had any real access to the internet, and so I essentially 'doodled' programs based off my rough,

Logo's a good choice if you know Logo well (which really means knowing Scheme), but a terrible language if taught badly. For young programmers, I'd recommend Smalltalk. Start with something like Squeak eToys and then go into depth. I've never met anyone who wrote good OO code and couldn't program in Smalltalk (but a lot of people who think they understand OO). Smalltalk is trivial to learn, but teaches you lessons that are useful in almost any modern language.

Seconded on the whole web programming thing. I suggest PHP. It's lightweight, has a C-like syntax to make the future transition to C/C++ easier, and integrates easily into an environment that kids already are familiar with (the web). It also has a lighweight notion of classes, making it a perfect choice for introducing OOP without the bloat of Java or the ugliness of C++.