Celebrating 50 Years of BASIC programming – Using a Raspberry Pi

Today is the 50th Anniversary of the BASIC programming language, and I got all misty-eyed thinking back to being an 11 year old learning BASIC for the very first time. I decided to do some small things to celebrate the language that started me off.

Happy 50th Birthday BASIC programming language!

The BASIC programming language is 50 years old. It was 35 years ago when I first sat in front of a Commodore PET computer at Stewards Academy (then Stewards School) in Harlow, desperately reading through the user manual and typing in my first numbered lines of a program listing. Just so you really know what this felt like, here is a picture of my Commodore PET running a simple BASIC program:

Thinking back to 1979 when I wrote my first BASIC computer program, I can still remember that exciting feeling of getting my first program to work. Strangely, I still get that same excitement even today in my day job, when breathing life into a new embedded computer project or running up a new programming language. The feeling is just absolutely magic, especially since my artistic skills are limited to poorly drawn stick men, computer programming allows me to express my creativity in ways that I could have never predicted when I first started.

MiniBasic on the Raspberry Pi

To celebrate the 50th Anniversary of the BASIC programming language, I have taken my Python flashcards that a lot of school clubs use to teach and learn the rudiments of Python programming, and re-written them all in BASIC. I have chosen to use Malcolm McLean’s MiniBasic, as it is small enough to learn in an afternoon, comes in two simple C files that you can compile with a single command on the Raspberry Pi, and if you like you can sniff around and understand and change his code too to learn a bit about C as well as BASIC.

Download the BASIC.zip file in the links section to your Raspberry Pi and follow the instructions in the readme.txt file to build and run your very own MiniBasic programs. It really is very very simple, and will take you less than a minute to get it all working! [P.S. you *might* have to use chmod +x build to make the build file executable, before you run it]

MiniBasic is fantastic, because it is so small there is a chance that you could read it and understand something about how it works. I remember as a 14 year old reading through some example code for a BASIC interpreter, and just about understanding how it worked inside. I was amazed that real programming languages were just normal programs like the ones I was learning to write!

That feeling was magic, and it was probably that moment that I realised that I really do like understanding how things work, rather than just consuming what others have written blindly. Conversely, I’ve come to really hate the scatter-gun approach of “rattle the nuts and bolts until it works, then ship it”. Understanding is safer, better, and puts you in a position of control and power.

Starting out with programming

The world has moved on a lot since then, but I was reflecting today on the humble beginnings of my programming experiments with BASIC on some of the early home computers like the ZX Spectrum and the BBC Micro, and wondering whether we’ve missed a trick still? One of the really nice things about these machines was you turned them on, they went “beep”, and you were presented with an instant command prompt. Off you go, type in that program and learn how to do it!

I really liked learning on the old home computers of the 1980s, partly because of this “instant on” and the feeling of “I’m in full control of this”, but also because I had a lovely spiral bound printed manual that stayed open on the desk while I typed the programs in and modified them, and there was a very nice well written reference to all the words in the language that I would need to know to create my inventions.

Of course, computers have advanced significantly since the 1980′s, and good job too – we do so much more with them these days that a language as simple as BASIC wouldn’t hold up to the graphical user interfaces with multiple threads and internet connectivity and gesture interfaces we are all used to.

But I have two points to make, to anyone who took the time to read on.

[1] Spiral bound computer manuals with a complete reference section in them are fab. Kids can leave them open on the table when working from them, the reference sections were really well written and told you everything you needed to know.

[2] A small language like BASIC was a really quick way of learning to program, because you could tick off the words in the language as you used them. There was some feeling of a finite boundary to what needed to be learnt to be proficient, and the real creativity came from how you put those parts together.

I do like Python now. I used to hate it, but I decided I love it. It’s a great tinkering language. It has modules for all sorts of useful things, and there are some lovely community developed add-ons that you can make some really fantastic projects with. But sometimes, just sometimes, I miss that “turn it on, beep, get programming”, and I miss having a finite bounded language that I know I can read the lovely spiral bound reference manual to get straight to the facts. I could use a combination of those facts and my imagination and creativity to create something fantastic.

Today, sometimes (only sometimes), it feels like I (and others) spend hours on the internet downloading wrong instructions, reading forums with people who send me off on tangents or are trying to explain things they don’t understand themselves, or trying out code from other people, that clearly doesn’t work.

Myself, I prefer to get the facts from an authoritative source, understand how things work, and apply all that with my own imagination and creativity to build the things that I want to build.

Have fun with MiniBasic. It really is very small and you’ll run out of steam very quickly with it, but at that point you’ll probably be sniffing around the C code and learning all sorts of interesting computer science things about recursive-descent parsing anyway!

Links

[1] Time Magazine article, about 50 years of BASIC:

http://time.com/69316/basic/

[2] BASIC.zip complete with all my flashcard programs re-writen in MiniBASIC.

[3] Python Flashcards

[4] Malcolm McLean’s MiniBasic code

[5] Malcolm McLean’s MiniBasic book

 

This entry was posted in Older Stuff. Bookmark the permalink.

Comments are closed.