Watch on Instagram

Code Bytes · "Start Here: What Is Coding?" · Episode 2 · The big picture

What a programming language is

A computer's chip only understands machine code, ones and zeros. A programming language is the middle ground, words and symbols people can read that a tool translates into machine code. Different languages use different words for the same idea, like print("Hi") in Python and console.log("Hi") in JavaScript.

Posted · About a 1 minute watch, 3 minute read · Take the quiz

What the chip really understands

Deep down, a computer's processor (its chip) only understands machine code: instructions stored as numbers, which in the end are long strings of ones and zeros. Each family of chips has its own set of these instructions.

Machine code is fast for the chip, but very hard for people to read or write. Nobody wants to build a game by typing 10110011... all day.

The middle ground

A programming language fixes that. It gives you words and symbols people can read, like print, brackets and quotes. Then a tool translates your code into machine code the chip can run.

`` your code → translator → 1s and 0s → chip ``

(There are a few kinds of translating tools. A later Code Bytes episode explains the difference; for now, "a tool translates it" is all you need.)

Different words, same idea

Programming languages are a bit like spoken languages: "Hello" and "¡Hola!" are different words for the same idea. To show Hi on the screen:

In Python:

``python print("Hi") ``

In JavaScript:

``javascript console.log("Hi") ``

Both print the same thing:

`` Hi ``

The words differ (print versus console.log), but the idea, "show this text", is the same.

Why there are so many

Languages were made at different times, for different jobs, and each one suits some jobs better than others:

  • One language is built into every web browser, so it runs web pages (that one is the comment question!).
  • Python is popular with beginners and for working with data.
  • Java runs lots of big business systems, and many Android apps.

Learn one, the next gets easier

The big ideas carry over from language to language: steps in order, repeating things (loops), making decisions, and storing data. Once you know them in one language, learning the next is mostly learning new words for ideas you already know.

Try it yourself

Open any free online Python editor (search "online Python") and run:

``python print("Hi") print("Hello from Python") ``

You should see:

`` Hi Hello from Python ``

Now change the words inside the quotes to your own name and run it again. The language stays the same; only your message changes.

Good to know

  • Every snippet on this page was run: print("Hi") with Python 3 and console.log("Hi") with Node.js; both printed Hi.
  • "Ones and zeros" is the beginner version: machine code is binary-encoded instructions, and different chip families use different instruction sets.
  • "A tool translates" covers both compilers and interpreters; a later episode explains how they differ.
  • Browsers can also run WebAssembly, which other languages can be compiled to, so "built into every browser" means the browser's own scripting language.
  • The popularity claims (Python for beginners and data, Java for business systems and Android, alongside Kotlin) are widely reported trends, not exact rankings.

Answer to the comment question

Which language is built into every web browser? JavaScript. Every major web browser can run JavaScript directly, which is why it is the language of interactive web pages. That's also where console.log("Hi") shows its output: in the browser's developer console (or in a terminal if you run it with Node.js).

Test your knowledge

Quick quiz: What a programming language is

4 multiple-choice questions. Pick one answer for each, then check how you did.

1What does a computer's chip understand directly?
2What is a programming language?
3In Python, print("Hi") shows Hi. Which line does the same job in JavaScript?
4Why does learning a second language get easier?

Sources

Video transcript

Python, JavaScript, Java. Why are there so many coding languages?

Deep down, a computer's chip only understands strings of ones and zeros, called machine code. People can't easily write that.

A programming language is the middle ground. You write words and symbols people can read, and a tool translates them into machine code.

It's like spoken languages: different words, same idea. To show hi on screen, Python says print. JavaScript says console dot log.

Each language suits some jobs. JavaScript is built into every web browser. Python is popular for beginners and data. Java runs lots of big business systems and Android apps.

Learn one, and the next gets easier, because the ideas carry over.

Which language is built into every web browser? Comment your answer below!

That's your byte.

More from "Start Here: What Is Coding?"

All "Start Here: What Is Coding?" lessons