How to teach students to code (program computers) inexpensively

Are you interested in teaching kids how to program ?

Are you a parent who would like to help your child learn how to program, but don’t have a lot of money ?

Are you a teacher interested in teaching your students how to program, but the school won’t provide the tools , so you have to pay for it out of your own pocket ?

Well, here is an inexpensive solution, which likely will get the ire of many a professional programmer and college professors, but trust me when I say it can work.

Forget about modern computers and modern programming tools

Step 1 is to buy a computer which is affordable which can do the job of teaching what programming is all about. Most families and classrooms likely have access to a television. Hopefully they may even have access to a decent large screen television which will make it even better. So what kind of computer are we talking about and why a TV ?

The 1980’s is when the home computer trend really got its start. Those early computers cost more than many of todays PC’s. They were amazing machines for the time. What is interesting is how many of those computers, rather than ending up in the dump, have survived all these years and are still available via Ebay, thrift stores and the like. Now some may think that those computers are so old that they are obsolete and useless. True, they won’t be running Photoshop or the like, but we only need them to do one task and that is, to teach children how to program a computer. Ok, they won’t run Microsoft Visual Studio, but they actually have something better, BASIC built in. Ok, likely you have heard some say that BASIC is a backwards language and that one needs to learn how to write software using the latest object oriented programming language. Well, let me put that old wifes tale to rest. BASIC, especially the version in old time home computers, is very valuable in teaching how to code. Let me explain the reason why here and how you can use an old time computer to teach the core principles of programming and inexpensively.

BASIC and the home computer

The BASIC language in old time home computers is easy to learn. The language is more like our human language we speak. The syntax is very minimal, so one does not get caught up with all the object oriented stuff which makes coding more complex and time consuming. The BASIC that came with these computers is interpreted, which simply put means while it is slower than a compiled language, one can run the code immediately to get immediate results. This is important to a student to get a better understanding of the relationship between code and what the computer does. Trust me when I say it works. I started on such a computer, using Basic and the things I learned have lasted for decades. Actually, I personally feel that core coding skills have been lost in recent years because of modern programming languages, which can be learned when using those old time home computers and the built in Basic language.

Coding is about logic, about using math to control that logic and about understanding the flow of code. Its not about drag and drop development environments or building 3D games or mobile apps. Much of what is done today in programming is done using high level tools, libraries and languages which shield a programmer from real coding.  The less a programmer has to write the code, the better, is the mindset of many a programmer today. But some programmers with similar experience to my own, instead think in code. They can do things with code, some times better than others do with high level drag and drop development systems. Why ? Because they understand the real power of well written code.

The home computers of the 1980’s and what can be learned from them

So, if you are looking for a cheap way to teach computer programming, here are the steps to take:

(1) Buy yourself a 1980’s home computer with a built in Basic language. The two best computers are the Commodore 64 and the Texas Instruments TI-994A . You find great deals on Ebay:

http://www.ebay.com/sch/i.html?_trksid=m570.l3201&_nkw=commodore+64&_sacat=0

http://www.ebay.com/sch/i.html?_odkw=TI+99+computer&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0&_nkw=TI+99+computer&_sacat=0

Be patient and you likely can pick up one of these computers, or even a couple of them, for a very low price. Don’t buy the first one you see. Wait for a deal.

(2) If possible, see if you can find an audio/video (RCA ends on one end) cable for the computer, so you can connect the computer to the AV inputs on a television. Otherwise you will have to connect it to the attenna connection and make sure the TV supports the old style analog inputs. The AV cables are readily available (you can even find the schematics to make your own, online).

In the classroom, one could connect a Commodore 64 (or TI=99) to a large screen TV using the AV inputs so all the class can see it. Students could take turns on the computer and have the whole class comment about the code and share in the process.

BASIC on these computers is so simple that most any teacher can learn it and teach it. Ok, this won’t prepare the students for programming modern apps, but it will do something better. It will get them excited about coding, teach core logic skills and something better. Epecially with commodore 64, the architecture of the computer is very well documented. Students who learn quickly, can start to learn concepts like machine language programming and how things like RAM and ROM work. I learned 6502 machine language using Richard Mansfield’s book ( http://www.amazon.com/Machine-Language-Beginners-Richard-Mansfield/dp/0942386116 ) “Machine Language for beginners”.

Understanding the concepts of bits, bytes, machine instructions, ram and rom are crucial and better appreciating higher level programming languages. Yes, the experience with more low level aspects of programming can help produce better programmers in the long run.  Actually, even today inexpensive embedded devices (yesterdays computer chips on low cost modern devices) use some of the principles learned from machine language programming.

Rather than spending hundreds of dollars on modern PC’s, these low cost available old time home computers provide can provide some great learning experiences. Maybe you teach electronics also. These old time computers can be cheaply interfaced with all sorts of DIY’er projects. The internet is loaded with them. They cost so little, that you can afford to let students take them apart to examine how they work.

Now while the old BASIC interpreters are very simple and lack many modern language constructs, key aspects of the language can be carried right into some modern languages, based on BASIC. There are many BASIC compilers available on the web, some free (like FreeBasic), some parsers for C (like BCX) and others stand alone professional quality compilers (like PowerBasic). Don’t think BASIC can hold its own today ?

Consider this example. Watch this youtube video:  http://www.youtube.com/watch?v=D9fvdfE59_Y

At about 4 minutes and 33 seconds into the video, pause the video and notice the laptop pictured which is running software which is controlling Chevrons amazing underwater deepwater pipeline equipment (ROV’s). The software which is running this amazing equipment was written using PowerBasic (and my own GUI engine built using PowerBasic).

The lessons I learned in the 1980’s from using the Commodore 64 and TI/99 computers prepared me for coding modern software today. The low level coding I learned with those computers, beyond just Basic (ie. machine language) prepared me for writing modern software using techniques which allow me to build software which runs fast , but requires minimal hardware. I even got my first taste of using a compiler, by using the Commodore 64 (the Abacus Basic compiler). I even wrote my own compiler for the Commodore, using the Abacus compiler, so I could write a family friendly video game which I sold to the Compute Gazette magazine. I earned about $1500 from that game.

Personally, I feel that a young person would learn more about what coding is really all about from one of those old time 80’s computers than they would by using some of the software today which supposely teaches programming concepts via a game like environment. Computer animation and graphics are complex tasks, so if a student uses a game like software package which allows them to animate objects with just a few lines of pseudo code (ie. move turtle left) then they walk away with the impression that coding is easy and they have to do little work to accomplish something valuable.  Now let a student experiment with a Commodore 64 and at first they may not be impressed with a simple PRINT “Hello”, but give them time to learn how the thing really works and when they figure out how to make sprites works and do some graphics with it, they will have learned some valuable lessons.

Coding is more about learning how a computer translates human commands into machine commands and how it accomplishes a task. Understanding simple concepts about how graphic screens display pixels and how much it takes to do it, builds better appreciation for the work a CPU (or GPU) has to do and how a programmers code is affected by this. The lessons I carried from my early years with the Commodore 64, still benefit me today and I have written things like a low level 2D sprite engine, 3D graphics engine using OpenGL, working with DIBs (device independent bitmaps), writing image filters and the like. Unlike many developers who use much higher level programming languages, I am an experienced WIN32 API programmer. Just like I did with my Commodore 64, today I still work at tapping into the lower levels of the computer operating system so I cna tap into its power and speed. And yes, I did learn a lot from that old Commodore 64.

Just like in wood shop class where beginners started with hand tools, rather than power tools, so too with programming, students can start with some old time home computers of the 1980’s to better appreciate how computers really work. Programmers like myself with that old time training, feel comfortable with even limited hardware. An Atom processor and only 1 or 2 gigabytes memory is a powerhouse compared to what we learned how to code on. Today many programmers can’t even feel comfortable coding without a super powerful icore processor and 8 or 16 gigabytes of memory. Old time programmers learned how to work with little and get maximum results. So teaching students how to code with an old Commodore 64 can teach some valuable lessons. Just think, the typical PC today has a CPU running at least 1 gigahertz or better. A gigahertz is 1000 megahertz. The Commodore 64 CPU ran at a tiny 1 megahertz, which ia 1/1000th the power of a modern CPU. Actually it is much less, since modern CPU’s since they have all sorts of “bells and whistles” to make them run even faster.

It was amazing how an excellent team of programmers were able to create even a GUI operating system to run on the Commodore 64, called Geos. With only 64 KB of memory and 1 mhz CPU, the Commodore 64 was able to run a GUI environment. Yes, the real challenge of programming is learning how to push the hardware far beyond what the computer creators imagined. It is this kind of programming skill that many companies could benefit from today.