Get Coding!

Hello future programmer! If you've landed on this page, you probably are looking to learn coding, and may be unsure where to start. Here you'll find some resources, as well as advice.

Where to Start

In order to begin your journey, you need to decide what skill to learn first. There are a few options. You want to learn something which will:

  1. be beginner-friendly
  2. teach good practice, and
  3. help you learn the fundamentals

Some of the classic options include:

  1. Python. This is the gold-standard of entry points to coding. It's both friendly enough for beginners and powerful enough that much of the world's most complex software is built on it. You can't outgrow Python.

  2. HTML and CSS. This has a less steep learning-curve, and a lot of people find it a nice way of becoming accustomed to a code-style way of thinking and working. Neither HTML nor CSS is actually a programming language, but it introduces some relevant concepts.

    Once you know HTML and CSS, a logical next step is JavaScript. JavaScript is a programming language designed for use in websites. It's not as straightforward as Python, and has some quirks so, if possible, it would be best to try your hand at Python before JavaScript, even if you begin by learning HTML and CSS.

  3. The command line. Every computer has a command line (also called a terminal or shell) - a way of typing instructions directly to the operating system. Learning a few basic commands can allow you to create and move files and folders (directories) and run code just by typing into the terminal.

    That might sound old-fashioned, but it's extremely powerful, and once you're used to it, it's often faster and more flexible than pointing and clicking.

    One of the biggest benefits of learning the command line is that it helps you think like a programmer. You can learn it alongside Python or any other language. In fact, doing both together is a great way to start!

  4. Languages with a scientific focus. If you’re in science, engineering, or academic research, you might like to start by learning a language that was designed with that in mind, such as MATLAB, R, Julia or even Fortran. These often come with libraries and tools specific to your field, and are widely used in universities and research settings.

Some people also find that learning C/C++ (which is widely used in scientific programming) is a good way to start.

Python

There is an abundance of useful, often free resources on learning Python as a beginner. The first thing I always recommend for people looking to learn, however is the book I learned from: Python Programming for the Absolute Beginner by Michael Dawson. It hasn't been updated for a number of years. However, it provides a really solid grounding, not just in Python, but in how to think like a programmer. It includes vital advice about good practice, which is something you have to start considering at the very start if you want to succeed in coding.

Other very well-regarded starting points are:

HTML and CSS

A very good resource for this is W3 Schools. Try going through their HTML and CSS tutorials. The courses are very clear, although not all modern syntax is discussed. I wouldn't recommend them for programming languages such as JavaScript or Python, however.

The Command Line

Generally speaking, command line usage is best learned by doing. Once you know a few key commands, the best way to learn is to look at the documentation. Here is an introduction to command line usage.

Languages with a Scientific Focus

Where to start depends on which language you want to start with. While Python is good for some scientific applications, you might want a different language in certain situations:

  • You might want to be able to deal with vectors and matrices right out of the box, or you may want to be able to handle functions analytically. In this case, MATLAB is very useful. The best resource for this is probably MATLAB's own self-paced tutorials, such as the MATLAB Onramp for beginners.
  • If you want an easy way to get common statistics, you can use R for this without having to use any additional libraries.
  • The best use of Fortran is in cases where time-efficiency is crucial. Compiled Fortran code can run many times faster than non-compiled code, depending on the task and the options given to the compiler. Fortran has it's own beginners' tutorial.

General Advice

There are a number of considerations to keep in mind when learning to code:

  • Learning by doing is the absolute best way. Once you've picked up a bit of basic syntax, try applying it to a real-world scenario. For example, when I was a novice, my mother had a problem. She would download data from the University's system about a list of students, in the form of a spreadsheet. If the student had some field with more than one entry, such as two nationalities, the spreadsheet would have two lines for them, each with identical information apart from the duplicated field, which would list one per row. I used Python to make it so that each student would have one line, and a field where the student had more than two entries would become a comma-separated list in one cell.

  • Make mistakes. You should not be afraid to make mistakes, nor should you feel bad about making them. Apart from the fact that even seasoned programmers are constantly fighting bugs in their own code, making mistakes is a very valuable way to learn.

    Crucially, if you get an error message, read it and try to understand what it's telling you. If it's unclear, look it up. Error messages are a rich source of education.

    Also, you should deliberately try to break your code. The more you see what can break, the more you learn how to make your code unbreakable.

  • If you want to know how to do something, first consider if it's possible with what you already know and, if not, look it up. Liberal use of search engines is extremely helpful. Often, the site you end up on is Stack Overflow or another site in the Stack Exchange network. These are brilliant resources.

  • A note on AI: I honestly can't imagine what it's like to be a beginner in the current age of generative AI. It's not clear yet whether making a lot of use of it when learning to code makes for more or less skilled programmers. There are arguments either way.

    Having basically a personal tutor who can answer all your questions and never gets sick of hearing from you could be extremely valuable.

    On the other hand, if you get it to tell you how to do a certain task and you don't make sure you fully understand it, you won't learn effectively.

    The way I tend to use AI is very similar to how I use StackOverflow. If there's something I can't figure out without extra knowledge, like how to print to the screen in a language I'm not familiar with, I might ask AI. If I ought to be able to work it out with the knowledge I already have, I generally would not ask.

    However, that's not to say that asking AI under those circumstances is unethical. The hard line, which nobody should cross, is putting out code where you don't understand every line. This was true in the days before the AI revolution - finding a bit of code online and using it without understanding it risks something going wrong.