Learn to Program in BASIC or Python

In my KS3 programming lessons, I'm teaching students to "program" using BASIC (although I have also created Python versions of the resources).  I don't like the term "coding", because coding has other meanings in relation to databases and encryption and could confuse students.

We're starting with Just BASIC, giving the students the opportunity to move onto Visual Basic once we've mastered the basics. I chose BASIC for a number of reasons - it's easy to learn and doesn't have confusing syntax with braces and semi-colons, but it still has some variable typing and standard programing structures such as loops, decisions and arrays.  Unlike Python, progressing to Visual Basic allows you to create normal-looking form-based Windows applications with ease, and also allows you to create Office macros in VBA or program web-pages using ASP or ASP.net.

Python is also quite a poor match for GCSE and A level Computer Science, as it doesn't support some of the programming concepts from the theory sections of the course - arrays, constants and passing by reference, for example, all appear in the specifiations and can't be used in Python.

Not sure that programming is for you? Watch this video and come back in five minutes! If you are interested in programming, but think would like to start with something simpler, why not try Scratch? I have created some Scratch examples using interesting and/or useful programming techniques.  Programming is a compulsory part of the Computing National Curriculum at KS3 in all state schools in England - you are required to learn two different languages, at least one of which must be text-based. You can also use programming to investigate other areas of the curriculum.

Key Programming Concepts

Below are links to presentations explaining the key programming concepts. I have written an article describing my top ten programming techniques for older students, but these are the ones that I start with at KS3. They also include code examples in BASIC or Python.   The list may expand as the course is extended, so come back soon if there's something else you'd like to see here. There playlists for programming in Python and programming in BASIC on the Computing and ICT in a Nutshell YouTube channel.

There are wider computing concepts spread throughout the site, but for interactive examples aimed at younger students, have a look at the Interactive section.

You might also want to cover general programming ideas such as:

Programming Tasks for Beginners

Here are some of the programming challenges that students could approach to begin with - there are versions of most tasks for BASIC and Python:

Most tasks have extensions, and we encourage students to enhance their programs beyond the bare minimum, where possible.

If you enjoy attempting tasks like these, then why not register for Project Euler or the Ubuntu Forums for some more challenges?

Examples in Just Basic

You can download a .zip file containing solutions to these tasks and other examples created in Just Basic. For Python examples, see below.

Programming the Curriculum

Why not link with other areas of the new Computing National Curriculum by getting your students to create programs to demonstrate, or test their understanding of key Computing concepts? You can create programs for converting numbers to binary (using bitwise Boolean logic or otherwise), for sorting and searching, to demonstrate the use of Exclusive-OR for encryption, or to help them think about the storage of text by capitalising text or creating anagrams or shift ciphers. Download some examples in BASIC or Python.

Learn to Program in Python

Someone's done a good job selling Python to schools - it seemed to pop up out of nowhere in recent years. I'm not sure that it's the best language to begin with, because things like for loops and arrays are different from nearly every other language I've used, there's no need to declare variables or be careful with types, and it doesn't support things in GCSE specifications such as arrays and constants. Creating a Windows form-based application is also particularly fiddly compared with something like Visual Basic, or even HTML and JavaScript.

However, I am aware that a lot of schools use it, so I have adapted a set of the above presentations and example programs to use Python.  You can download all of the presentations and some example programs below:

Both sets of files are in a .zip file / compressed folder. There is no presentation on arrays for Python - it has been replaced by the one on lists and tuples.

There is also a set of examples available on my Repl.it page - click on the heading Andrew's Public Repls to see the full list - and, finally, I'm slowly working my way through the OCR Coding Challenges.

JavaScript Examples

There is no JavaScript course, but I have created a zipped file of JavaScript examples that can be used to demonstrate key techniques to students, particularly changing text and colours on the page to display state. Examples include choosing lottery numbers, a traffic light, a die model, a seven-segment display, a Simon game, and rotation. There are also more generic examples in the JavaScript section of this site, and examples of how you can add animation to web-page without using any JavaScript at all.

Video Courses

I am developing video courses on how to learn to program on the Advanced ICT YouTube channel:

For older students I have also written articles on the use of modular arithmetic, using arrays for selection, creating functions and object-oriented programming in Python as well as my top ten programming techniques.