As BASIC celebrates 50 years, a revival is needed

On the 1st May 1964 BASIC (Beginner’s All-purpose Symbolic Instruction Code) programming language was initiated when at 4 a.m. Professor John G. Kemeny and student programmer Thomas E. Kurtz (who later became a professor) simultaneously typed RUN on neighbouring terminals in the basement hall of Dartmouth College in New Hampshire. When they got back the correct answers to their programs, BASIC was officially born. This innovation implemented the concept of time-sharing on computer systems and set in motion a chain of events which would lead to computers becoming available to all.

At the time, computers were generally used by science and mathematics students, and required custom written software. Data and programs were often stored on punch-cards and paper tape [Footnote 1], with magnetic tape being introduced in 1951. During the 1970s there was rapid growth in different flavours of BASIC, additional functions were added with extra structuring keywords and advanced floating-point operation features.

With the introduction of 8-bit home computing, from the ZX-81, Commodore VIC-20, ZX Spectrum, Commodore 64, BBC Micro & Acorn Electron, Amstrad CPC 464 and other models and makes of the 1980s, versions of BASIC became widespread and were often integrated into the computer’s firmware (ROM chip) along with an interpreter and operating system commands. Cassette tapes were used for data storage and retrieval initially and later floppy disks.

ZX Spectrum BASIC example
ZX Spectrum BASIC example

Upon powering on a home micro an interpreter prompt would be displayed, this enable writing BASIC programs or executing commands built into that hardware platform’s operating system. For example, to load a word processor package (e.g., Tasword) one would type LOAD “” and press Enter. Then play the tape. Friends with attached Interface 1 + Microdrives or floppy disks with the later ZX Spectrum +3 (Amstrad) would be able to load data at a much faster rate than cassette tape.

With the growth of 8-bit home computing, complete source code for computer games and other programs were published in magazines and books. In the UK the BBC embarked upon a Computer Literacy Project using BBC BASIC. Over the years BASIC has continued to develop, notably with Microsoft’s Visual Basic. Some teaching guides such as the AQA A/AS Level Computing books still provide examples in Microsoft Visual Basic, however this version of BASIC is closer in structure to Python or Pascal rather than 8-bit computer BASIC.

ZX Spectrum Keyboard
ZX Spectrum Keyboard

Higher level languages such as Pascal and Python can be confusing to someone who has never seen program code before and absolute beginners could also start with Scratch. While BASIC was not liked by all programmers, I believe that it is still an excellent introductory path in learning how to program. Once one has got to grips with programming in a BASIC language, whether one is using ZX Spectrum, BBC, True or any other flavour of BASIC, the next step would be to move onto Pascal, Python or Microsoft Visual Basic.

There are many Integrated Development Environments (IDEs) available to write programs in, such as Microsoft Visual Studio on Windows, Xcode on Mac OS, or on Linux/BSD (and Windows & Mac) Code::Blocks and Qt Creator.

However if one wants to go retro and get to grips with coding, a ZX Spectrum or BBC Micro emulator could be loaded onto Windows, Mac or Linux/BSD based OS computer. Excellent resources to start with are World Of Spectrum and BBC BASIC. Alternative hardware platforms to desktop & laptop computers are available for learning how to program, notable the Raspberry Pi.

Programming will open a whole world of fun, thinking logically and aid in the learning of algorithms. Problem solving skills will be acquired along the way, and with the growth of coding clubs, opportunities are available to learn in a group.

While the days of the 8-bit home computer hardware with built-in BASIC interpreter have been superseded by more advanced processor technology, and some may believe that technology has progressed beyond BASIC programming,

the age of Basic programming has gone

this need not be the case. With 8-bit emulators (ZX Spectrum, BBC Micro, et al.) available to run on Windows, Mac OS, Linux/BSD operating systems, and RISC OS available for the Raspberry Pi, BASIC programming is available for all to start learning.

Footnotes.

[Footnote 1] 1. Magnetic drums were widely used during the 1950s-1960s for computer memory, which was superseded by magnetic-core memory. Later followed transistor memory, and with the invention of semiconductor circuits the first RAM chips were used during the late 1960s, becoming commercially available in October 1970 with the Intel 1103.

Resources.

BBC BASIC
World of Spectrum
Visual Basic
Code Club
Coding Club
Computing for teachers
Raspberry Pi

Advertisements

Model B of Raspberry Pi on general release

With the launch of the Raspberry Pi earlier today 29th February 2012 (6 AM GMT), I found myself being flabbergasted and happily amazed in equal measure. It took me over an hour to get onto Premier Farnell‘s website early this morning and about 20 minutes to access Radio Spares Components. I initially held off ‘registering an interest’ for a RasPi on RS as Premier Farnell had stock today, however @Raspbery_Pi twitter-sphere soon indicated Farnell had sold out in just over an hour and RS were not selling today. Soon after I ‘registered an interest’ for the Raspberry Pi on RS.

For Farnell and RS it might have seemed like a co-ordinated DDoS as requests flooded in due to demand for Model B RasPi. For me not being able to get onto these sites (as for many I suspect) has been both frustrating and exciting, as this signals the start of an exciting journey for the Raspberry Pi from 1st generation onwards. This also demonstrates a success story not just for computing technology enthusiasts, hobbyists and experts alike, but exemplifies a thirst for learning, imagination and creativity for many, due to the scope an inexpensive pocket computer running an open-source OS (Linux) can be used for.

While the media is currently focusing on programming aspects of Computer Science, the RasPi opens up computing technology for many not just in learning programming, but also for understanding how stuff works as well as for fun. With accessories such as the Gertboard due to follow later this year, the RasPi can also be put to use in other science and engineering projects, from designing robots through to controlling them.

A frenzy of excitement and anticipation has been slowly built-up over the past 9 months. I first came across the Raspberry Pi project via BBC’s Click 4th June programme where David Braben speaks with Peter Price about the Raspberry Pi prototype; you can see Eben Upton in the video setting up the prototype. With announcements of the Raspberry Pi Model B’s imminent release from November 2011 through to February 2012, anticipation has grown and word on the RasPi has spread. Necessary delays to the initial projected first consumer release have crept in due to improvements and testing, however I think the wait has been worth while.

With production of the RasPi now entering into licensed manufacture with British companies Premier Farnell and RS Components, it shouldn’t be too long before the rest of us get our hands on a RasPi… I am waiting excitedly! One of the big unknowns for the Raspberry Pi Foundation and computer enthusiasts alike was how the RasPi will be received? The initial RasPi Model B release for around £22 ($35 US) can be seen as a success with available devices quickly selling out. I don’t think this time around for the successor of the Acorn Electron (BBC Micro) they shall have stock left in warehouses, just the opposite.

I wonder if the RasPi will eventually end up being sold on the shelves of WHSmith stores, as the ZX Spectrum and Acorn Electron did back in the 1980s?

Postscript: For all those lucky enough to have their hands on a RasPi, if you would like to know where to download a Linux distribution, please point your browser at http://elinux.org/RPi_Community, and for an example of how to write the image file to your SD memory card using a Unix or Linux based OS, please see http://wp.me/p1KP49-3v. The example I provide is for Mac OS X users, however these instructions are translatable for any *NIX OS.

How-to Write a disk image to a SDHC card

This brief document describes how to write a Raspberry Pi ARM disk image to a SDHC memory card on a Macintosh. Raspberry Pi boot images can be found from their download page: http://www.raspberrypi.org/downloads.

Raspberry Pi Downloads page
Raspberry Pi Downloads page

Due to the vast amount of traffic on the RasPi website’s download page, I would recommend either obtaining an image from using a BitTorrent client or downloading from a mirror site. Download mirror community sites can be found through the elinux RasPi website: http://elinux.org/RPi_Community. This example uses an ARM Debian 6 image from UK mirror site http://www.raspberrypidownload.co.uk/.

A RaspberryPi Download Mirror Site
A RaspberryPi Download Mirror Site

Select the Debian or other Linux distribution ARM image file you wish to download and save to your “Downloads” folder. Unzip the “debian6-17-02-2012.zip” file within a Finder window.

Insert a SDHC card which should mount to the desktop; you may need a card reader that can attach to a USB port. A 4 GB SDHC should be sufficient to store the Raspberry Pi disk image on.

SanDisk 4GB SDHC Memory Card
SanDisk 4GB SDHC Memory Card

Launch your Terminal application: “ApplicationsUtilitiesTerminal“.

Assuming the image has been downloaded to your user “Downloads” folder, the following commands can be typed at the Terminal prompt “%“:

% diskutil list

Identify the disk volume where the 4 GB SDHC card has been mounted, e.g.,

  • /dev/disk3
  • #:     TYPE NAME                                SIZE             IDENTIFIER
  • 0:     FDisk_partition_scheme        *4.0 GB        disk3
  • 1:      DOS_FAT_32 NO NAME         4.0 GB        disk3s1

Please note: to continue, you will require administrative (super-user) privileges.

Dismount the 4 GB SDHC disk; be careful not to dismount other disks you have on your computer, such as your “Macintosh HD” or “Time Machine” backup disk.

% sudo diskutil unmountDisk /dev/disk3

Write the disk image to the SDHC card.

% sudo dd if=/Users/<username>/Downloads/debian6-17-02-2012/debian6-17-02-2012.img of=/dev/disk3 bs=1m

Note: Please replace <username> with your login account’s username; this is the short-name which can be seen in the Terminal preceding the “%” or “$” prompt symbol.

The command prompt “%” will be left hanging during the writing operation and will appear once completed. The writing process could take between 10 – 30 minutes.

Below is an example of this process:

  • [macosx:~] mylogin% sudo diskutil unmountDisk /dev/disk3 
  • Unmount of all volumes on disk3 was successful
  • [macosx:~] mylogin% sudo dd if=/Users/mylogin/Downloads/debian6-17-02-2012/debian6-17-02-2012.img of=/dev/disk3 bs=1m
  • 1886+0 records in
  • 1886+0 records out
  • 1977614336 bytes transferred in 1785.959001 secs (1107312 bytes/sec)
  • [macosx:~] mylogin%

Once completed, the SDHC memory card can be ejected and the Terminal application can be closed.

SDHC memory card can now be inserted into your Raspberry Pi computer.

Could the Raspberry Pi be the best innovation for 2012?

With imminent release of the Raspberry Pi Model B computer, I thought a follow-up article to “How do I become a computer programmer?” maybe useful. The main focus of this article was to provide some pointers for children and adults who would like to learn programming. However programming is not the only skill set one can learn with a Raspberry Pi.

Suggesting some of the available options on how to learn programming can often be analogous to choosing a different flavour lollypop; not all of us like the same flavours; nor lollipops. While there are a wide selection of programming languages available, such as Ruby, Python, Java, BASIC, Pascal, C (and its derivatives) to name a few, and then there are a plethora of (text) editors and IDEs (Integrated Development Environments) available along a trek of many “Computer says no” (//** Syntax Error **//) to successfully navigate your learning progression through, the important thing not to lose sight of are the learning outcomes. These can be key to a successful and happy journey along the winding forest path of learning something new.

How new information is processed and learnt is often dependent upon how a book or a trainer communicates with the learner, as well as how the learner processes the new information; the language used can determine a successful outcome. Computer science follows other science subjects, whether they are astronomy, biology, ecology, chemistry, geology, physics, in that they follow the scientific method. Regardless of what science subject one takes at school, generally we are taught the scientific method.

One issue with the current English ICT lessons from what I have read, is that they teach how to use specific applications, such as Microsoft Office products. Computing At School (CAS) aims to promote the teaching of Computing at school to readdress this imbalance. A computer science syllabus teaches more than programming. There is a whole spectrum of subjects, from computer architecture through to security and cryptography. More importantly, as with any science subject, what is taught are methods that provide learners with the necessary tools on how to solve problems, rather than learning how to use specific tools.

Learning how to solve problems using those tools is a much more useful skill to learn. Getting children hooked into learning a new subject in an engaging and fun way, can stimulate and aid the learning process. During the 1980s/1990s there were home micro computers which spurred on one’s imagination. No longer were computers in comic books and science fiction programmes like Doctor Who, they were in our living rooms; a small part of “Tomorrow’s World” had arrived. Today technology pervades most aspects of our lives, directly and indirectly. Learning basic terms and ideas, and putting these across in a way which stretches a child’s imagination and thirst to learn can be empowering.

This is where an ingenious innovation of a pocket-sized computer steps in. The Raspberry Pi Foundation’s main project goal is to produce an inexpensive computer (Model A) for kids to use at home and in school for a variety of learning opportunities. The obvious use for the Raspberry Pi is to teach programming (one aspect of Computer Science) and to be used with a reformed ICT curriculum in schools. However there are many other opportunities for the Raspberry Pi and its partner Gertboard to aid learning in and out of classrooms, and this need not be restricted to children in the classroom; science-hacks for example.

Some ideas that spring to mind are: a physics project for rocket/balloon ship, engineering robots for various fun tasks, using graphics design to create a kite, coding algorithms that model planetary objects or a rocket ship’s return trip to Mars in a game, etc.

Let your imagination fly and have fun!

How do I become a computer programmer?

With news stories earlier last year following the Raspberry Pi foundation‘s mission to get computing science taught in schools, a lack of programming skills amongst British citizens have been highlighted. For the past 15 years (± 5 years) schools have taught ICT (Information Computer Technology) skills, which are useful, but have left a whole generation of children and young adults without valuable coding skills within the early 21st century information age. A small number of schools teach computer science, however this has not been the norm due to the National Curriculum’s ICT policy; this maybe about to change.

One may ask why should this matter? Well within the 21st century it matters because of our dependence on computing and information technology for so many aspects of our lives. During the first golden age of home computing in the UK and many other countries around the world, the Sinclair ZX-81 and ZX Spectrum, Commodore VIC-20 and 64, Acorn Atom, Acorn BBC Micro (Proton) and the Acorn Electron brought the ability not only to play computer games, but also enabled children and adults to use these micro computers to learn programming and how they worked.

BASIC was the primary programming language one would learn, aided by computing magazines and TV programmes of the era. Instructions with computer code could be programmed into a home micro and saved to cassette or disk. I can recall spending many hours coding into my ZX Spectrum a program which would allow one to land a lunar module onto the surface of the moon. It was these experiences that enthused and engaged my passion for computing.

So how do I enter into the world of computer programming?

It is never too late to enter into the world of computer programming, for young and older alike. While learning to program may not be everyone’s idea of fun, learning rudimentary programming skills and having a reasonably competent understanding of how computers and communication devices work is an essential skill for the 21st century. However if you would like to know more than just the basics, what can one do?

A previous route would be to study computer science at school level, arguably a route that has not been available to many, following a beginners GCSE guide through to A Level computer science, then moving onto an undergraduate computer science degree. Fast forward to 2012, if you are at schooling age, programming tools such as ALICE, Scratch or Kids Ruby maybe a good place to start. There is a good article written by Emma Mulqueeny called “How to teach code” which provides further information.

However if you are no longer at schooling age and want a doorway in, then I would recommend a general computer science book for beginners. There are many books available, finding the right book for your learning needs will aid your learning. A quick web search for “beginners computer science” or “computer science A Level” should provide a list of book resources.

If you already have a good basic understanding of computers, for example grew-up in the world of ZX Spectrum, BBC Micro (Acorn Computers), Commodore 64, Atari ST, Commodore Amiga, or the early Disk Operating System (DOS) versions of CPM, DR-DOS, PC-DOS or MS-DOS then you will most likely have been introduced to BASIC (Beginner’s All-purpose Symbolic Instruction Code) programming and possibly also the world of machine code.

For all of those who still recall the golden age of computing under the ZX Spectrum, check out Dave Foreman’s unofficial “Sinclair User” website. In particular you might like to start reading articles on “Machine Code“.

If you want to jump the basic introduction to computer science or have a good enough background knowledge, the next stage is to look at books for high-level coding, such as with Pascal or ‘C’ family programming languages. A quick web search for “beginners programming” should provide a list of book resources. There are also many on-line resources and learning-apps available. A free resource worth mentioning is codeyear.com, which aims to provide learning materials on a weekly basis for a year to educate one on becoming a programmer.

Many applications that run on Windows, *NIX (UNIX/Linux) and Macintosh Operating System (OS) are generally compiled using a form of the ‘C’ programming language. If you are committed to becoming a programmer, then one should delve into the ‘C’ language family, with a comprehensive book that takes you from starter to advanced. A small caveat: regardless of age if you would like to see quick results, there are many other high level languages to start with, such as BASIC, which is still a favourite of mine.

The ‘C’ programming language family main flavours consist of: ‘C’, ‘C#’, ‘C++’ and ‘Object-C’; there are also subsidiary languages such as Java (programming language). Generally speaking, the ‘C’ language family has differences in the form of syntax used; this is similar to the grammar rules of a language. Writing code can be done with text editors. However to make coding tasks easier, all modern operating systems (Windows, *NIX and OS X) have Integrated Development Environment (IDE) tools to aid a programmer. In general all modern operating systems can compile the ‘C’ programming language, the root ‘C’ language, using a compiler such as gcc.

If you use Visual Studio on Windows OS and associated ASP.NET, you would most likely use ‘C#’ language; however you could also use a ‘C++” compiler and language. For Macintosh OS X and iOS the choice of language is ‘Object-C’ with IDE Xcode. For Unix/Linux OS flavours you could use ‘C’, Object-C and ‘C++’ languages. Java programming language can be coded on all popular OS platforms.

Once you become competent programming in ‘C’, you should expand your language coding abilities to include scripting languages such as Python, Pearl and PHP; also learning Java would be advantageous. Then further expand your programming skills to include HTML and XML languages.

Another area to learn about is databases. There are many different flavours of database, the more popular Relational Database Management Systems (RDBMS) are SQL language based, for example: Microsoft SQL, MySQL, PostgreSQL and Oracle SQL. Many applications including web-based applications will store information within databases.

While mastering a scripting language, HTML and databases, it would also be advantageous to consider learning more hard-core computing skills such as machine code in the form of Assembler language, computer hardware functionality, networking and disk storage systems. This will help to improve your overall understanding of computer science.

However learning how to code is not enough in itself. Learning how to draw goes hand-in-hand with learning how to code. Learning both programming and drawing skills together will be advantageous for working in the video gaming and visual effects industries; in short, skills working towards becoming a polymath. If you are a musician or have music theory training, you already have an advantage.

Once you have mastered a ‘C’ language, scripting languages, SQL, assembler, drawing… you may also consider expanding your programming skills by learning new computer programming languages, such as Fortran as well as other scripting languages. This will be dependant upon the field of work you wish to follow, or maybe for fun, or just to seek new knowledge.

Family computers can be expensive and complicated machines. Most families would be cautious about allowing a family member to install development tools for coding. Netbooks and low-cost PC laptops can be used with Windows OS to install IDE applications. An alternative is to install a Unix OS like PC-BSD or a Linux OS like Ubuntu with IDE tools. For those who understand a little more about computers, there is also the Google Chromebook which can be modified to install a copy of Ubuntu and IDE tools. Windows, UNIX and Linux OS can also be installed into a virtual machine environment on your existing computer using VirtualBox or other virtualisation technology. Also a USB flash drive or SDHC card could be configured to boot a *NIX OS with IDE tools installed if one has supporting hardware.

A more simpler solution is about to become available with a new inexpensive computing alternative provided by the Raspberry Pi foundation. The Raspberry Pi computer will come in 2 models, A and B. Model B will have in addition to model A, ethernet networking and more memory stacked on the processor. Model A is set to retail for $25 (£16) and model B for $35 (£22). The early releases during the first quarter of 2012 will not come with a case, they will be exposed computer broads, however cases will be available later for both models. A keyboard and mouse will be required as well as a TV with coaxial or HMDI input; the Raspberry Pi is capable of full 1080p video output. A power adaptor or batteries will also be required; a standard phone charger will work with the Raspberry Pi. The Raspberry Pi’s computing function is based on an ARM1176JZF-S 700-megahertz (MHz) processor that will be capable of running Linux or RISC OS. Fedora, Debian and ArchLinux will run from SDHC cards and external USB devices such as HDDs (Hard disk Drives) can be attached.

Raspberry Pi is the successor to the BBC Micro and follows on from the first golden age of computing in the UK during the 1980s-1990s.

I have provided below a small selection of recommended books, programming tools and an inexpensive hardware platform to work from. Although there are many resources available, these recommendations are useful as a guide if you don’t know where to start.

Book recommendations

  • Drawing For Dummies, A Reference for the rest of Us!, Brenda Hoddinott, 2003, Wiley Publishing Inc, ISBN 978-0-7645-5476-6. This edition has been superseded with a new 2011 edition.

Tools for programming

  • Macintosh OS X: Xcode, Code::Blocks, QT Creator, GCC.
  • Windows OS: Visual Studio/Visual Studio Express, Borderland C++, Code::Blocks, QT Creator, wxDev-C++, GCC, LLVM (Clang + MingGW).
  • Unix/Linux OS: Code::Blocks, QT Creator, GCC, wxDev-C++, LLVM (Clang + MingGW) and many more.

Tools for Drawing

  • Paper, eraser, pencils, ruler sets, etc.
  • SketchBook, Paint, Paintbrush, GIMP, Blender.

Hardware platforms

For hardware please take a look at the Raspberry Pi.

Emulation

Fuse (ZX Spectrum) for Windows, Macintosh and Unix/Linux.