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 a few tools specifically aimed at helping young people get into coding. One is the BBC micro:bit, which is being given to students in Year 7 for free, but which you can also buy for £15. You can code for it using a variety of tools and languages including MicroPython and JavaScript.

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.

Learn to code - Swift Playgrounds

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.

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.

 Learn to code