Computer Science for Kids

by: Ted Felix

Computers in the late 1970's, and early 1980's didn't come with Windows, they came with a programming language called BASIC. As its name implies, BASIC was designed to make computer programming easy. When you first turned on your new computer, you were greeted by BASIC saying something like "READY" or "OK". Computers from this time were meant to be programmed by their users. Computer makers expected their customers to learn to program their new computers, so they included programming information in computer user manuals. Book stores carried many titles related to programming personal computers. Many of them were written for children.

These days, no one seems to care about teaching kids to program computers. PCs are mainly used for Internet access. Very few people are even aware of the fact that the computer can be programmed by the user. BASIC no longer comes with a new computer. Programming books for kids are no longer published.

In an attempt to remedy this situation, the following is a collection of information intended to help children learn to program. It is also intended to help adults teach children about programming, and maybe even help adults learn to program too.

Logo

Logo is a fun and easy to learn language that is a perfect first programming language. Kids can quickly master the basics of moving the turtle and drawing interesting pictures. Logo is great because it teaches the fundamentals of programming. It teaches the step-by-step nature of programs, and important concepts like procedures.

What you need

To program in Logo, you need an interpreter like MSWLogo. MSWLogo is cool because it is free. Unfortunately, the user interface is a bit difficult at times, but that's the price you sometimes pay for free software.

An alternative to MSWLogo is KTurtle which is available with KDE for Linux. This means you'll need to run Linux instead of Windows. While KTurtle is nowhere near as comprehensive as MSWLogo, I think its combination of turtle graphics with QBASIC-like syntax is a good idea.

Learning Aids

For learning Logo, I've developed the following aids. Note that some of these commands might not work in some versions of Logo as each version tends to use different words. As an example "RIGHT 90" might be "TURNRIGHT 90" in some versions of Logo. These aids were developed using MSWLogo.

Logo Review (MS Word) - A reference card containing some of the most useful Logo commands. It is limited primarily to the Turtle Graphics commands plus a handful of other useful things. You can do quite a bit with this subset of Logo.

Logo Color Activity (MS Word) - Logo's ability to display colors based on Red, Green and Blue (RGB) values is a lot of fun to play with. This worksheet lets you try some RGB values, and identify the colors.

Books

Here are two Logo books that I recommend and some that I've not checked out:

Jim Muller, The Great Logo Adventure - Covers the Logo language very thoroughly and is written for kids. You can find a PDF version of this at the MSWLogo site.

Teaching With Logo: Building Blocks for Learning (Molly Watt and Daniel Watt 1986) - Written for teachers, this book covers an approach to teaching Logo in an elementary school classroom. Unfortunately out of print.

These I haven't checked out:

Motherboard Books has two Logo-based computer science books for kids.

MSWLogo's site lists more Logo books that can be found on the Internet.

After Logo

Beyond the basics outlined in my Logo Review, Logo becomes a rather strange language by today's standards. If you aren't using KTurtle, I recommend switching to QBASIC once everything in the Logo Review is mastered. It's easier to learn variables using QBASIC because the syntax is slightly easier to understand.

KTurtle is a great example of a language that is similar to QBASIC but includes Logo's turtle graphics. It is included in KDE which is a desktop environment for Linux. If you don't mind running Linux, KTurtle is worth trying out.

QBASIC

QBASIC is another great beginner's language. In fact, the "B" in QBASIC stands for "Beginner's". The main difference between QBASIC and Logo is that for more complex programs, QBASIC tends to be easier to understand. For example, the following two programs do the same thing. First the Logo version:

MAKE "A 2
MAKE "B 5
MAKE "C :A + :B
PRINT :C

Now the QBASIC version:

A = 2
B = 5
C = A + B
PRINT C

Even though they may both look confusing at first, the QBASIC version might look a little more familiar. It's like something you might see in math class.

When you want to write more complicated programs that let the user have control, you'll find QBASIC to be easier to use than Logo. QBASIC also looks more like the programming languages professional programmers use (Visual Basic, Java, and C++). Once you become good at programming in QBASIC, learning a language like Java or C++ will be easier.

It would be nice to have a language that adds turtle graphics to BASIC. KTurtle is the closest I've found so far.

What you need

There are several versions of QBASIC, and many places where you can download them. Do a Google search on "qbasic.zip" and you should find it pretty quickly.

The MS BASIC Repository has many different versions once you become more advanced.

Books

Since there are no QBASIC books written specifically for kids (QBASIC came long after the push for kids to program), I wrote my own: QBASIC Programming for Kids. Motivated kids can read through this book and learn quite a bit about QBASIC on their own.

Sample Programs

You can't learn to write if you don't read. The same goes for programming. Just like with English, you won't learn much from poorly written programs. Unfortunately, it is very hard to find well-written QBASIC code. In an attempt to solve that problem, I've taken some of my old favorite programs and rewritten them in QBASIC the "right way".

Capture - A game that I wrote after seeing something similar on the Commodore PET. I've cleaned it up pretty well, used SUBs, and made it CPU speed independent. Tons of comments have been added to make the code easy to follow. This is a great example of how to program a real-time game in QBASIC, and also an example of what can be done with very little code.

Snowflake - Snowflake generator.

Star Split 2 - Starfield simulation.

William Tell - Shoot an arrow at the apple on your victim's head.

Links

The QBASIC Forum - Lots of great folks hang out here and can help with your QBASIC problems.

What's Next?

Beyond QBASIC, there are many routes to take. It is pretty important to move on to Object Oriented programming next. The chances are pretty good that once you start to outgrow QBASIC, your programs will have a lot of SUBs that have STATICs and SHAREDs. This is a sign that Object Oriented thinking is needed. Visual BASIC 7.0 (.net) would probably be the gentlest transition from QBASIC to object oriented programming. Java or C# would be a slightly bigger leap, but look better when you want to go out and get a programming job. And there are lots of jobs in computer programming.

Check out Java Programming For Kids by Yakov Fain which is a $20 e-book. I haven't read this, but Java doesn't strike me as a good language for beginners. Its event-driven nature and large complex libraries make it pretty daunting.

Books

Check out my kids computer book collection where you'll find lots of historic and some current computer book reviews and recommendations.

Links

One Laptop Per Child - These are geared toward programming with Logo included.

National Computer Camps - Why not go to computer camp for the summer? If you're lucky enough to live near one, that is...

Kids and Computers - Story of how a kid and her dad learned Logo using MicroWorlds Logo.

Kids Domain, Teaching Kids Programming - List of resources for learning programming. Covers lots of stuff, but no QBASIC. Might be a good place to find things like Cocoa for teaching younger kids to program. Mostly Mac stuff.

O'Reilly's REALbasic book - REALbasic for the Mac is a simple windowed BASIC that is very easy to learn and use.

BASIC Computer Games - Written in "old-school" BASIC replete with line numbers. This was the way we used to get "freeware" back in the day. It'd be a good idea to rewrite some of these in QBASIC using good style. They would be great examples to learn from.

Screaming Penguins - These guys have redone a few of the classics in JavaScript. Haven't looked closely at their code, but their philosophy is sound.

Squeak - Programming system for kids based on Smalltalk. I haven't played with this yet, but it might be worth checking out.

Python - I've heard rumors that Python might be a good beginner's language, but I have my doubts. I need to learn it and see if it is any good.

KPL - "Kids Programming Language". Requires very modern hardware and the .NET framework. You can't run this on anything prior to Windows XP. Since my kids have retro 486 laptops, we won't be using this. QBASIC works great on any PC. It doesn't really matter which language you learn, but the more languages you learn, the better you'll be. So it does pay to look into other languages such as this.

<- Back to my Technology page.

Disclaimers: This is my attempt at gathering together the various resources I've used when teaching my own kids to program computers. I am not affiliated with any of the companies mentioned in this page in any way other than as a customer. All trademarks are owned by their respective owners. There are no ads on this page, and there never will be. Use this information at your own risk. I won't be held responsible for anything that happens to you as a result of reading this. Shake well before serving. The contents of this page are Copyright 2003 Ted Felix, All Rights Reserved.

Copyright ©2003, Ted Felix