A friends of mine has an exceptionally bright 9-year-old who has recently gotten into computers in a big way. The friend has asked for my help in finding some materials to get him started on programming.
Now, back when I was a young 'un, every PC included a Basic programming environment, and writing and executing a simple program was pretty straightforward. But as best I can tell, this is not the case any more. In fact, it seems that most PCs don’t come with any built in environment or programming tools.
So what’s the standard way to get a kid started on programming these days?
Web programming is also a great way to get your toes wet today. Start off with basic HTML/CSS/Javascript, upgrade to PHP later when interest in doing something with the site peaks. That’s all free too, you could run a copy of Uniform Server on your dekstop and be up and running just a few minutes.
I haven’t tried it myself (or with my kids), but Scratch from MIT is designed to introduce kids to programming:
You could also get an Apple II emulator (AppleWin, for example) or whatever computer your friend used when he was a young’un and use that BASIC programming environment. It might encourage some bad programming habits, though.
I don’t think MacOS Developer Tools (or any other IDE system) would make a good introduction for a nine-year-old. There’s too much ancillary stuff you have to learn about before you can sit down and write code.
I’m actually a big fan of the MIT Scratch project, and other highly visual languages. (Whatever happened to Prograph?)
And I agree with posters above who mentioned web programming. You can start with some simple HTML tutorials and then try doing some Javascript. You only need a text editor and a web browser.
Java is free. Learning Java from O’Reilly is an excellent book (I did know C, but that just meant I could skip over the chapters explaining the syntax. All you need to develop is a text editor.
The first thing I used to get my feet wet was the “Learn to Program BASIC” CD-ROM, which had tutorials and a structured sort of learning with videos. It went through the basics and concluded in a full sprite-based video game (which, I must admit, was a bit beyond me). A bit later, I moved on to Visual Basic 4, in which you could down a few textboxes, buttons, and make a real, useful GUI program. I used a book to learn the basics of Visual Basic, which wasn’t hard but requires literacy. Of course, your friend can do the reading and then show the kid together. I don’t think Visual Basic .NET will be any more difficult than VB4 if you just stick to basics. (To continue my history: I left off programming for a while, then returned by reading through a C++ How to Program by Deitel and Deitel, which was a really good guide. I also learned DirectDraw and made this Wolfenstein-type game to win the 9th grade science fair. But, C++ is pretty sophisticated and much of its complexity isn’t used anymore. I really wouldn’t start with it.)
One thing I just discovered which looks really, really cool is Microsoft SmallBasic. It’s a simplified IDE with an excellent, excellent IntelliSense system and you can draw and do various things. I haven’t used it, but really looks like something to check out. I think it’s still in Beta.
Decided to download Small Basic and try it out. Basically, it is a very simple IDE that lets you write console VB.NET programs using a simplified syntax.
instead of
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Console.WriteLine("Hello, World")
End Sub
End Class
It also has a GraphicsWindow class which lets you draw stuff and build sprite-based games/animations. It’s got some other nifty classes, like the Flikr class.
For i = 1 To 10
pic = Flickr.GetRandomPicture("mountains")
Desktop.SetWallPaper(pic)
Program.Delay(10000)
EndFor
This does exactly what you think it will. Cool.
But, ultimately, it’s v0.4 and it shows. The IntelliSense looks cool but is poorly worded and is missing important info. There is no documentation except the Getting Started PDF, and this is just an intro, it doesn’t explain all the classes. You also can’t draw GUIs, although Small Basic has the concept of events and you can process mouse clicks, etc. received by the GraphicsWindow.
Tried to check out Alice, and it seems pretty complex with a bad-looking IDE. And all you do is make animations with Alice, so it’s pretty limited and not real freeform programming.
Scratch is a bit more developed. Take a look at its Getting Started Guide: http://info.scratch.mit.edu/@api/deki/files/567/=ScratchGettingStartedv13.pdf I kind of like its graphical programming interface (with the caveat that it’s unlike any real language and may be cumbersome), but ultimately, like Alice, Scratch is about animations, story-telling, and making sprites dance around. Too… how shall I put it… girls-oriented
Eh, there’s very little ancillary stuff needed to write a .c source file and run it through gcc. I’ll grant, though, that c probably isn’t the best choice for a starter language.
I also found Phrogram. Like Small Basic, it is another BASIC that’s integrated into the .NET universe. This one’s quite a bit more sophisticated (and certainly no early beta). It has great docs (in fact, it comes with a book), solid support for graphics/sprites/keyboard input/etc, a VS-like IDE. But, still no GUIs (why?). Oh, it also costs $50 (plus $15 for the book).
Here’s a program that flies a spaceship around the screen using the arrow keys:
Program KeyboardControlledSprite
Method Main()
Define MySprite As Sprite
Define LocationX As Integer = 290 // This will place the sprite halfway across the screen
Define LocationY As Integer = 225 // This will place the sprite halfway down the screen
MySprite.Load( "ufo.gif" )
MySprite.MoveTo( LocationX, LocationY )
MySprite.Show()
While IsKeyDown("Q") = False
Delay ( 10 )
If IsKeyDown("Right") Then
LocationX = LocationX + 3
End If
If IsKeyDown("Left") Then
LocationX = LocationX - 3
End If
If IsKeyDown("Up") Then
LocationY = LocationY - 2
End If
If IsKeyDown("Down") Then
LocationY = LocationY + 2
End If
MySprite.MoveTo( LocationX, LocationY )
End While
End Method
End Program
Bloody object orientation. In my day, you could walk into a computer shop and type
10 PRINT “DAVE IS A WASSOCK”
20 GOTO 10
or the more sophisticated version that I employed
10 FOR J = 0 to 10
20 PRINT SPACE$(J);“DAVE IS A WASSOCK”
30 NEXT J
40 FOR J = 10 TO 0 STEP -1
50 PRINT SPACE$(J);“DAVE IS A WASSOCK”
60 NEXT J
70 GOTO 10
to achieve a pleasing zig-zag effect. Worked with minor modification on any computer.
These days you have to set up base classes, and agonise over whether to use the Model-View-Controller paradigm. Fuck that.
I agree that C++ is very complex (what other language allows a standard-compliant compiler to reformat your hard drive if you omit a virtual destructor from a polymorphic base class? :D), but what exactly do you mean by “much of its complexity isn’t used anymore?”
C++ is indeed a beast of a language, but the only features I can think of off the top of my head that few people actually use (whether intentionally or unintentionally) would be exception specifications and non-public inheritance. And of course, the language as a whole is only getting even more complex in the next revision of the standard. (A natural progression of C++'s design philosophy, which in short is “nail everything we’ve ever heard of onto C.” ;))
I know you’re just griping, and I agree that OOP is dramatically overused and abused these days, but every good developer chooses the right tools for the job; nobody in their right mind would worry about base classes or MVC for such simple tasks.
Actually, basically I just meant pointers and memory management. When I was thinking about what a beginner would have to know to start doing cool things, that’s what struck me as “much of its complexity” and “not used anymore.” Of course, there’s plenty of other equally complex stuff in there and proficient users of modern languages use those concepts quite a bit.
I’m also being biased against low-level programming. Which is ironic, since I’m a low-level programming guy. I guess I’m being self-hating.
If you can swing it, Lego Mindstorms would be a really good way to go. It’s a robotics kit with a programming language apparently based on the G language used in Labview. G is a fun language where you draw lines representing the paths that your data takes from module to module, and when a module has all its input data, it executes and provides outputs. There are ways to add loops and control panels and all sorts of other things.
It’s not cheap, though, as YamatoTwinkie mentioned; the basic Mindstorms set is around $300. Plus you still need a computer to run the programming environment on, and connect to the Lego robot you build.
I would have been thrilled to get it as a nine-year-old.
Of the free downloadables, perhaps Squeak might be interesting? Or Python?
Ah, so you were just referring to the fact that people have (rather sensibly) moved to higher-level languages for many applications now. Fair enough there, though I still love me some C++. In my experience it’s a language that probably 99% of its users don’t really understand, but I’ve spent more than ten years learning its intricacies and idiosyncrasies, so I’m not going to let go of it now!
I personally like Smalltalk, but having used Squeak before, I cannot recommend it for anybody, let alone impressionable young minds! The user interface is the most hideous thing I have ever seen, and that’s saying something. It has a color scheme which I will charitably describe as being “extensively informed by the aesthetics of chunky vomit.” And it didn’t help that the the interface was also cluttered, visually confusing, and maliciously documented. As I recall, there were parts of the UI with color-coded buttons, and a text-only tooltip that helpfully explained the meanings of the various colors, including, but not limited to, “beige,” “pink”, “tan”, and “pinkish tan.” (There may have also been a “pinkish beige-tan” option.)
Whoever designed the Squeak environment was obviously trying to make people suffer. :eek:
I’d third the Mindstorms, though, even if they’re rather pricey. You can also get a Java interpreter running on your Mindstorms kit, so you have an upgrade path for “graduating” to more useful languages in the future.