In this lesson, we will look at what a programming language is, what language computers really use, and types of languages people use to communicate with computers.
Computers Don’t Speak English?!
You and I feel, think, and live inside bodies (separate vessels made up of tissue), that end with the skin at our fingertips – so we can’t feel what another person is feeling, or know what another person is thinking. But, to get along and work together, we invented language to bridge this barrier. I say something to you, you figure out what I said and my thoughts end up in your head so we can both laugh at the same joke, or work on the same task.
Well, computers live and think in vessels too… so we need a way to tell them what we want, so we can work together and get stuff done. Programming language is how we can talk to computers. It’s a lot like English but it’s kind of quirky too. Unlike people, machines cannot guess our intent. We have to be super meticulous and describe what we want in every little detail.
How Computers Think?
Computers don’t actually use words or meanings the way humans do. Instead, computers are made of gazillions of tiny switches that are either on or off. When they’re on, we call that a 1, and when they’re off, we call that a 0. When you put those together, you get options. If you put lots of them together, you get lots of options. Each chunk of options can now be something meaningful (a number, a letter, even a picture made of tiny dots). Ta-dah! Now we have a way to tell a machine to do stuff using these simple bits of information (strings of 1s and 0s).
The trouble is, it’s really clunky to tell a computer to do stuff using that language, binary, which uses only 1s and 0s. So, we layer several human-like languages on top of the binary language to help translate machine language into human language. This gives us a more human way to tell the computer what we want it to do.
But you know how people are – everybody has their own idea of the best way. So, there are tons of human-like languages to choose from. In the end though, every language meant for a machine ends right back at simple 1s and 0s, and that’s all the computer cares about.
Types of Languages
There are three main kinds of programming language:
- Machine language
- Assembly language
- High-level language
We just went over what machine language is – it’s the language of machines, consisting of bits (1s and 0s) put together into chunks like bytes, a group of 8 bits, and lots of other larger sizes. It’s highly unlikely you will ever have to write in machine language, but in the old days, we used to plot 1s and 0s on graph paper and then type them in, to make pictures appear on the computer screen. Very tedious!
Assembly language is a little easier than machine language, but not much! It uses more convenient numbers, symbols, and abbreviations to describe the huge strings of 1s and 0s, to make it both easier and more memorable to type in instructions. The computer knows that certain strings of numbers are commands, so assembly language lets you use English-like strings instead of numbers to refer to those. Plus, with assembly language you have access to all kinds of resources to organize your programming code. Then you tell a program called an assembler to assemble your instructions, which just means they get turned into 1s and 0s for you.
The third type of language are the high-level languages. These languages use English-like statements and symbols, and are independent of the type of computer you are using. You can even put in lots of English labels and comments to help remember what the instructions are doing. This makes your programs much easier to read and modify. There are far more high-level languages than any other type of computer language, each one tailored for a certain kind of use.
People use language to work together and accomplish things. We use language with computers too; these special languages are called programming languages. They are the instructions which need to be followed to see what we are hoping to see. But computers think in terms of 1s and 0s — yes or no, in a way. We can string 1s and 0s together into really long strings representing lots of choices (or many different things, such as numbers, letters, pictures, and commands).
On the downside, it’s way too clunky to communicate this way, so we need something better, and it comes in 3 ways: machine language, assembly language, and high-level language. Machine language is the binary language made of 1s and 0s. Assembly is made of abbreviated commands we can assemble into machine code. And high-level language is a lot like English and is computer independent.
Some famous high-level languages are FORTRAN, COBOL, C++, BASIC, and Java. There are also scripting languages for the web.
Programming Language: Key Terms
- Programming language: a language used with computers to instruct them to do what we want them to do
- Bits: simple pieces of information made up of strings of 1s and 0s that are used in programming language
- Binary: programming language that uses only 1s and 0s
- Machine language: the language of machines that consists of bits
- Bytes: group of 8 bits
- Assembly language: programming language that uses more convenient numbers, symbols, and abbreviations to describe the huge strings of 1s and 0s
- High-level language: programming language that uses English-like statements and symbols and is independent of the type of computer used
- Scripting languages: programming language used for the web that does not get translated into machine-readable code until the very last moment
After completing this lesson, students should be able to:
- Define programming language
- Identify the types of programming languages available
- Describe the uses of the different programming languages