Skip main navigation

Avoiding ambiguity

Avoiding ambiguity. Commands

Computers are not very clever, and they don’t do very clever things. They appear to be doing clever things, however, just by doing incredibly simple things very, very fast.

How fast are we talking exactly? Well, a 3 GHz processor is doing around 3bn of these very simple things per second. Instructions like, ‘add 1 to this value’ or ‘change the current location in memory to equal this location’, for example.

Every single thing that your computer does, from displaying a web page to playing some music, is the result of a huge amount of these very simple instructions being executed very fast. This is low-level code.

Fortunately, when we write code, we don’t need to break our processes down to this level. We can write what’s called “high-level” code, which is a code designed to be more usable by humans.

However, even though we can write at a high level, our instructions still need to be translated down to a low-level version for the computer to be able to run them. There is normally a special program to do this for you, but your code needs to be unambiguous enough that it is possible to do so.

What is ambiguity?

For something to be ‘ambiguous’, it just means that there is more than one way to interpret it. Think about the sentence, ‘I saw a man with a dog on a hill with a pair of binoculars’. There are a number of ways this could be interpreted:

  • You were on a hill, with a dog, and you used binoculars to see a man
  • You saw a man who had a dog and a pair of binoculars on a hill
  • You saw a man with a dog on a hill, using a pair of binoculars

Human languages are generally very ambiguous when spoken. We as humans can cope with this because we use context, body language, and guesswork to somewhat overcome this ambiguity. Computers are not capable of doing this yet, and thus when we are writing code for a computer, we need to be very specific about what needs to happen.

In order for our high-level code to be this specific, we need a language with some very rigid rules. In data science and programming this is known as the language’s ‘syntax’, which is simply a fancy word for ‘rules’.

© Coventry University. CC BY-NC 4.0
This article is from the free online

Get ready for a Masters in Data Science and AI

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now