Language for 9-year old?

Started by
72 comments, last by Fixxer 18 years, 5 months ago
I'd second BASIC. My brother tried to teach me C (or was it C++ - it was a bit of a different language then) when I was about 11 but I just found it too confusing. BASIC I managed to pick up quite easily and I moved on to C a couple of years later. And I recommend DirectQB if he wants graphics, no idea if it'll work on modern PCs though.
Advertisement
What I like about freebasic is that it keeps the simple basic language, like
sub whatever(this as integer, that as string) dim anotherVar as byte if this = that then  anotherVar = anotherVar +1 end ifend sub


Which I think is a much more obvious syntax then

void whatever (int this, char* that){ char anotherVar; if (this == that)   anotherVar++;}


Even despite having a much more natural feeling syntax, it supports things like pointers quite easily, though not yet as effectively as C, they are still there.
Freebasic is also in early development, and although its fairly young, its already quite powerful.
Kid's Programming Language
It's structured like BASIC, has it's own IDE, and even converts to VB.NET or C# so you can understnad what it's doing.
Quote:Original post by Ezbez
He might want to check out one of a handful of programs the let you create games(The Games Factory, Stagecast, Game Maker, etc.) if he is more into making games than learning programming.

Seconded.
I helped my brother (about the same age) with Game Maker a month or two back, and I was surprised at how powerful it actually was. It combines simple drag & drop functionality with the ability to "script" the game logic. It's basically like a small graphical programming language embedded in the program. I'd say it's a very good introduction to programming, especially for 9 year olds, who, to be honest, are more interested in making games than in learning the syntax for a programming language.
Quote:Original post by BleedingBlue
What I like about freebasic is that it keeps the simple basic language, like
*** Source Snippet Removed ***

Which I think is a much more obvious syntax then

*** Source Snippet Removed ***


Well, while it's true that BASIC has syntax that reads slightly more easily, in the long run that really doesn't help, because the goal is to write, rather than read, the syntax, and so it's really just a matter of whether you remember the word "integer" or "int" when you're writing the program. Also note than in your C code, there's really not much reason to do things like "anotherVar++" (you can do it exactly the way you did in your BASIC example, too) or use "char*" rather than the simpler std::string or omit the braces to open or close the if statement. From a beginners' standpoint, all of these things do nothing but add needless confusion.

If a nine year old can learn C++, then I'd say "why not" as this worked out perfectly well in my case. If C++ isn't what he wants, then you can go to simpler languages or game makers or whatever.

On the subject of game makers, the problem I had was flexibility. In general, I think they're a good thing, but they have limits. When I was learning to program, as soon as I stumbled upon a limitation or thought "years from now, this won't be able to do what I want, so why waste my time with it now?" and didn't bother with it.
-~-The Cow of Darkness-~-
Standard ML.

EDIT: I guess I should qualify that. Standard ML is very strictly typed, meaning that once a program gets past the type checker, it will work with a decent probability (no messing around with debuggers to try to find what's causing a crash). It's also implicitly typed, the type system automatically infers the types for you (although you can explicitly state them if you like). It has an interactive top level. A 9 year old can start using it as a calculator almost immediately and then slowly work his way up from there. ML requires no manual memory management. It's a relatively small language, so few keywords need to be learned, yet, when the time comes, it has a powerful module system that will help properly structure programs.

[Edited by - MDI on November 12, 2005 7:21:40 AM]
I think what I found good about QBASIC was that it was totally procedural - no worrying about event loops or anything even remotely complicated to start off with. Just SCREEN 13 and... well I've forgotten the keyboard input command, but getting going with a program which I could understand and see the results of, instead of having to copy-paste most of it and try not screw it up when I wanted something a bit different. In a lot of ways DOS programming was very easy to learn compared to Windows.
I second FreeBASIC. It's a very powerful language, despite being young, and the syntax is quite simple. Also, you can use most of the APIs that C uses, and it also supports stuff like pointers, function pointers, etc. Also, OOP is planned for later releases.

I started with QBASIC when I was 9, also, and FB is so similar to QBASIC that for the most part, you hardly have to make changes. It's basically 32-bit QBASIC++.

Here is the compiler itself, but that's commandline, you can also get both the compiler and the IDE for it here.

There are some QBASIC tutorials here, but they will work with FB AFAIK.
Quote:Original post by cowsarenotevil
How motivated is he? If he just wants to make games and isn't profoundly interested in math/logic/etc. one of the various game maker tools might work. But if he's really interested in programming or wants to emulate the way professionals do it and you think he'll be able to remain motivated, not to mention extremely patient (programming can be very, very painful, and sometimes you just get completely stuck for a while), there's no reason to assume he can't start with C++. I was about 9 when I started learning C++ and somehow (I really don't know), I've held on to that motivation for six years.

It's important to have some guidance, though, which can be difficult if neither parent programs (unfortunately, elementary schools do not offer classes on programming). I actually got pretty lucky in this situation, because my older cousin had started taking programming classes in college shortly after I started trying to program, and I also stumbled upon the (now defunct) forums at cplusplus.com. I'm not sure I can really recommend online forums for a someone who's nine (particularly since this one has an age limit of 13. In some ways that bothers me, but it makes sense), but it worked for me (and I didn't get murdered by insane stalkers). Even so, I followed quite a few dead ends trying to learn (though I did learn things from all of them) and probably could easily have given up the whole thing.


I COMPLETELY did NOT read the whole thread. But accoring to the OP's problem, I totally agree with what I quoted.

If he wants to learn to program and make games(or just program, hehe) I suggest C++. I started with it from the beginning(11 years old, well, not exaclty 9...) and I'm still with it. Go C++. I have heard good things about python, too, though I never tried it.

If he is more into making games, try game maker or something.

EDIT: Dont try logo. Many say it's a good starter, and heck, in my high classes in elelmentary school they taught it. I wasnt in the high classes, but it's not that hard... But it's nowhere as good as C++.

EDIT2: No, C++ syntax is much, much, easier.

I reccomend that he try's some text's based games in C++. Then he should buy(well, not he, if he doesnt want to, but you) Beginning C++ Game Programming. This book teaches C++ from a gaming perspective, and you can learn many things from it. I learned from it. Once he buys the book he should try some things like a number guesssing game:
#include <iostream>#include <ctime>#include <cstdlib>using std::cout;using std::cin;int main(){    cout<<"\t\tNUMBER GUESSING\n\n";        cout<<"\t\tGUESS A NUMBER FROM 1 - 50!\n\n";        int guess = -1;        srand(time(NULL));        int theNum = (rand() % 50) + 1;        do    {        cout<<"Your guess: ";        cin>>guess;        cin.ignore();                if(guess < theNum)            cout<<"\nGo higher!\n";        if (guess > theNum)           cout<<"\nGo lower!\n";    }while(guess != theNum);        cout<<"\n\nYou got it!!!\n\n";        cin.get();    return 0;}

(Note: If he wants to learn he should learn. When he learns a lot, he can write this game in less than 3 minutes[like me], too)

Good luck!

[Edited by - agi_shi on November 12, 2005 10:44:33 AM]
I taught myself the basics of programming (loops, control structures etc), as well as english, with GW-BASIC on an 8086 when I was 9. What really helped were the gfx routines (SCREEN 2, LINE, CIRCLE etc) - otherwise I would have lost interest very quickly.

So, what I suggest is some version of BASIC (probably QBASIC, since it is very easy to use), and a good book. Another possibility might be Python with some gfx module, though it would probably be harder.

[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]

This topic is closed to new replies.

Advertisement