If you want to learn to code, we explain which languages you should learn and how to start programming and creating your own apps, websites, and more. Whether you're young, old or somewhere in between, programming is not only rewarding - it can earn you good money, too.
From 7-22 October 2017 it's EU Coding Week (the astute among you will note this is in fact two weeks) and this makes it is an ideal time to learn to code. You can find out more on the codeweek.eu website and you can check Apple's website as there will be free coding sessions at Apple stores for the same period (with thousands to follow over the next six months).
What language should you learn?
With so many different programming languages and, indeed, types of programming, the first consideration is which languages you should invest your time and effort in learning.
Do you want to create apps for smartphones and tablets? Would you like to design and build websites? There's even the programming of the embedded computers which are built into everything from your TV to your car. Each area requires radically different code, so while we can't decide which is best for you, we'll explain where to start looking.
If you expect to be learning to code in full-time education, there’s a good case for working with the languages most commonly used in schools. Alternatively, for those who hope to employ their coding skills in the workplace, we’ll give some thought to which languages are used in industry for various applications.
Just knowing which languages to learn isn’t enough, though. So we’ll also provide some guidance on what software you need in order to learn each language and which resources and courses will help you in your quest.
It’s important to recognise that there’s no single best language, though. In preparing this article we spoke with Mark Chambers, CEO of Naace, a community of educators, technologists and policy makers who share a vision for the role of technology in advancing education. Mark was keen to avoid recommending specific languages - indeed, the National Curriculum doesn’t require particular languages to be taught.
Resources for kids and teens
There are also plenty of coding games and toys for kids, ranging from kid-friendly DIY computer kits like the Kano to programmable robots like the Sphero SPRK+. These generally build games into the way they teach coding to help keep kids entertained as they learn.
Another option is Apple's Swift programming language. Apple has released a free iPad app called Swift Playgrounds which aims to teach kids to code in Swift using a fun game-like environment. It works on all iPad Air and Pro models, the regular iPad from 2017, plus iPad mini 2 and later. They will also need to be running iOS 10 or later.
Programming by blocks
One of the two most commonly used programming languages in schools is Scratch, which was developed by the Lifelong Kindergarten Group at the MIT Media Lab. Unlike most languages, Scratch programs are created by linking blocks together on screen.
This allows students to learn about the structure of programs and the concept of algorithms but without having to learn syntax, that is the exact textual format of an instruction in a conventional language. In addition, because the blocks resemble jigsaw pieces, their shapes reduce the likelihood of blocks being connected together when the end result would be nonsensical.
Despite this unconventional approach, Scratch genuinely is a procedural language, as are most of the popular computer languages. In other words, it allows the programmer to define a sequence of operations for the computer to carry out.
Scratch is often used in primary schools but it would be unwise to set an upper age limit, above which a student should learn a conventional language instead. It’s also used in secondary schools, indeed it could be beneficial for anyone who has never coded before, while recognising that it will always be a stepping stone to the types of language that are used in business and industry.
Scratch is available free of charge. You can either download a version to use offline or you can create programs directly on the website.
Another block-based language that is gaining popularity is Google Blockly – see our guide to getting started with Blockly. The BBC micro:bit also uses a block-based programming environment called Microsoft Block Editor.
The BASIC alternative
When there was last a big push on teaching computing in schools, BASIC was the language of choice since it was available on the BBC Micro as well as on many of the cheaper home computers of the time. Although it was designed as an educational language, though, BASIC’s continued use for learning to programme is the subject of some debate.
Some would argue that it’s an old-fashioned language that will get students into habits they’ll find it hard to break when they start to learn newer languages. Others say that, because it’s such a simple language, it better illustrates the way processors work than more modern languages and is useful because it provides this insight.
Pragmatically, BASIC is still taught in schools quite extensively because it’s more familiar to a large number of teachers. What’s more, in contrast to the “bad habits” argument, there are suggestions that it’s useful to learn different programming paradigms, something that studying newer languages alone won’t provide. All of this seems to suggest that BASIC is still a good language to learn, at least as part of the mix.
In its 50 years, BASIC has spawned a huge number of dialects. Newer versions of BASIC include concepts such as block structure and object orientation but there’s a lot to be said for sticking with a version that is true to its roots.
For a fairly basic BASIC, but with extensions to carry out graphics programming, SmallBASIC (not the same as another variant of the same name published by Microsoft) would be a good choice – it’s freely available from http://smallbasic.sourceforge.net.
Note that Microsoft’s Visual Basic (formerly called Visual Basic .NET and commonly still referred to as such), is very different from BASIC of old. Indeed the current version of Visual Basic is object oriented (which we'll explain in the next section) and is another possible contender if you want to learn this type of language.
The second of today’s most popular languages in education is Python. Unlike BASIC, this adheres to current thinking in programming such as block structure and object orientation. As such, it’s similar to C++ and C# which are widely used in industry (together with their predecessor C), although Python is generally considered as easier to learn.
We’re not going to delve into exactly what object orientation actually means – after all that will be something you’d become familiar with if you were to learn Python – but suffice to say that expertise in this type of language would be a very useful skill. You can download a Python interpreter from https://www.python.org/ - it’s free.
This is another object-orientated language so would be a logical progression from Python or, if you don’t fancy learning two similar languages, an alternative to Python, albeit one that’s not as commonly used in schools. If you want to learn Java you have several options. The Java Development Kit (JDK) is freely available and runs on your PC.
However, if you specifically want to try your hand at Android app development, you’ll need Android Studio and, in addition to the Java language, you’ll need to learn about the Android environment. You can download Android Studio but you’d be advised, first of all, to get to grips with Java itself before turning your attention to Android.
Most of today’s most popular languages are object-oriented. Although the syntax varies between the different languages, having learned one such language you’ll be in a good position to migrate to another. If you want to discover which are the most commonly used in industry today, take a look at the Ttiobe index.
Web programming - HTML and CSS
Coding for the web is very different from everything we’ve seen so far since, at its most basic, it uses a completely different type of language. Even so, it’s a vital skill to learn.
To create the simplest of web pages you’d use a language called HTML (and ideally the latest version, HTML5) which stands for HyperText Markup Language. As a markup language, it doesn’t provide a list of instruction that are executed in sequence as procedural languages do but, instead, it describes how text and images are displayed on screen.
Quite a lot of an HTML document will be the text you see on screen when it’s displayed on the web but, crucially, that text will be interspersed with so-called tags. For example, if some text is preceded by a '< h1 >' and has '< / h1 >' (we've added spaces and single quotes to prevent your web browser interpreting these as code!) following it, that portion of the text is displayed as a level 1 heading.
This is just a simple example and it gets more involved when you start to add graphics, tables and links, but the concept of tags applies throughout.
Trying your hand at writing HTML requires software that will already be on your PC. You can create an HTML document using an ordinary text editor like Notepad and, so long as you give it a filename that ends with .htm or .html, double clicking on it in Windows Explorer will cause your default web browser to display it, just as if it was hosted on the web.
Most web browsers will allow you to see the HTML source code that generated the page you’re viewing. However, going beyond this, dedicated HTML editors (e.g. CoffeeCup Free HTML Editor from www.coffeecup.com) offer additional features such as colouring tags for easy identification while editing, and perhaps the ability to preview how your page will appear in a browser.
In addition to writing HTML code, unless you’re working as part of a multi-disciplinary team, you’ll also need some graphics design skills. While we need to mention this to present the full picture, it would be stretching a point to refer to this aspect of web design as coding.
A webpage created using HTML alone will be static, but other languages allow you to create dynamic content. The very first step in this direction is the use of another language called CSS which stands for Cascaded Style Sheets.
We’ve seen how text can be turned into a header in HTML and, in the simplest of cases, the browser will use its own default font, size and colour for each level of heading. HTML does allow you to define these characteristics yourself but CSS provides a better way.
A separate CSS file defines exactly how each of the heading levels appears, making it easy to alter the appearance of an HTML document purely by specifying a different CSS file. Using a CSS file, every page on a company website can be given the same corporate look and feel without having to repeat the formatting information in every single HTML file.
The next stage in making web pages dynamic is to add code that responds to the user’s actions. This sort of dynamic code is executed, for example, when you login to a website.
There are hundreds of online HTML courses, including Build Responsive Real World Websites with HTML 5 and CSS3, Learn to Build Beautiful HTML5 and CSS3 Websites in One Month, and Learn Web Designing & HTML 5/CSS3 Essentials in Four Hours.
You don’t have to go it alone if you want to learn to code as there’s plenty of help out there. Many would-be programmers will already be learning to code at school, college or university but there are plenty of resources, either for those not in full-time education, or for those who want to augment their formal education.
The most easily accessible are the myriad online programming courses for just about any modern language you could imagine. As well as Googling for your preferred language, be sure to take a look at Codecademy. You should also check out Udemy, which has a broad range of online courses including plenty for coding.
Also look at adult education courses at your local colleges because being able to interact with a lecturer and chat with other students makes the learning experience so much easier. While some colleges only provide courses on using computers and software, some do offer evening programming courses at reasonable prices.
A concept that can benefit students in primary and secondary schools is the coding club. These are free, independent programming clubs for young people, that are led by volunteers and often sponsored by industry, that aim to supplement the teaching given in class.
We really hope that this guide has inspired you to get started in coding. Whichever language or languages you choose, and whether you decide to learn alone or in the company of like-minded individuals, there’s every chance that your learning experience will prove to be both a productive and an exhilarating one, and we'd love to hear your feedback in the comments below.