Programming Language Basics
Level 1 · How languages differ
What a programming language is, and why there are hundreds of them. High and low level code, and assembly, the one closest to the chip.
Course contentsLesson 1 of 12
Level 1 · How languages differ
Level 2 · Languages of the web
Level 3 · General-purpose and systems languages
Level 4 · Languages for phones
Level 5 · Data and functional languages
Level 6 · Scripting languages
After this lesson you can
- Say what a programming language is for
- Tell high-level code from low-level code
- Explain what assembly language is
10 mincovers 4 glossary entries
What a programming language is, and why there are so many
A programming language is a set of words and rules for telling a computer what to do. The chip itself only runs machine code, which is long runs of numbers. A language lets people write in words. Then a tool turns the words into those numbers. There are hundreds of them, and a few dozen are in wide use.
Languages sit on a scale. A high-level language is close to plain words and hides the machine's details. Python is one: print("Hi") shows text, and you never think about where in memory it goes. Most code written today is high level, because it is quicker to write and easier to read.
A low-level language is close to the machine. You manage memory yourself and think about what the chip is doing. That is more work and easier to get wrong. In return, the program can be very fast and very small, which matters inside a phone, a car or the core of an operating system.
The lowest you can go and still write words is assembly language. Each line is one tiny order for the chip, such as copy this number or add these two. Each chip family has its own, so assembly written for a laptop chip will not run on a phone chip. Few people write it by hand today.
So why so many languages? Each one was made to make some job easier. One is built for web pages, one for phone apps, one for statistics, one for code that must never crash. Every language trades something away to be good at its job. No language is best at everything.
This course is a tour of those trade-offs and of the main languages. It assumes you know what a variable, a loop and a function are, since every language here has them. It stops at the languages. How to shape a large program, with objects or with pure functions, is a separate subject.
People often think the first language decides their whole career. It does not. Once you know one language well, the second takes weeks, not years. The ideas carry over, and mostly only the spelling changes.
Worked example
Emma's thermostat and her website
Emma writes the code for a heating control box. Its chip has just 32 kilobytes of memory. She picks a low-level language, so she controls every byte.
The same week she builds the thermostat's website in a high-level language. There, memory is not a worry, and she finishes the page in 2 days instead of 2 weeks.
The words for this lesson4
Check yourself
What do you gain and lose with high and low level code?
Finished this lesson?
Marking it complete also marks its 4 glossary entries learned, which updates your roadmap and your saved page. 0 are already marked.