Lesson 5: High-Level vs. Low-Level
In our last lesson we took a brief overview of the history of programming. In that lesson we briefly mentioned high-level and low-level programming. In this lesson, we’ll expand on this a bit more.
What Level?
When we talk about high-level or low-level programming languages, we are referring to the level of abstraction from a computer’s native binary language. The lower the level, the closer it is to the computer’s native language, and the more component specific you must be. The higher the level, the more abstracted it is from the compilers native language and the more generalized it becomes.
Lowest-Level
The lowest of low-level programming languages is binary, the series of 0s and 1s that the computer actually processes. It is actually possible to program a machine in binary, though you probably wouldn’t enjoy the process.
A perk of programming in the computers native language is that there is no translation needed. It’s just like if your native language is English (your low-level language) and you also know Japanese (your high-level language). If someone speaks to you in English you can chat much quicker because there is no translation required. If someone speaks to you in Japanese, it is a bit slower because you probably have to translate it to English in your head, then translate your response back into Japanese.
This delay (or lack of) is known as the abstraction penalty. The more abstracted the language becomes, the more translation that is needed, so the slower it becomes.
You would only want to use binary on very simple machines where computational power is at a premium. A simple digital watch is likely programmed in binary, but it would take you an excruciating amount of time to program a word processing application in binary.
With binary languages, you pretty much can only write a program for a single device. On a different device, it is unlikely that it will work the same. So, you could say with binary programming, one program for one device.
A Step Up
The next step up from the binary language is assembly languages. Assembly languages are sometimes considered second generation languages (2GL), with binary being the first generation.
Assembly languages are still low-level, but they provide some abstraction to over the native language. However, you still have to be aware of minor caveats of the specific device you are working on, so that means you can’t write one program and expect it to work on all devices.
The language also looks a bit more like something we could read, with lines of code such as “ADD 5, X”, instead of “0011101010110011000″ (no, that isn’t a translation). So, it becomes a bit easier to program in.
For assembly languages, you can say that one program for a few similar devices.
Another Step
Another step up and you finally reach the low-end of the high-level programming languages. These languages are well abstracted from the underlying hardware. These languages can be referred to as third-generation language (or higher). Examples of these languages are Javascript and PHP, as well as languages like COBOL, FORTRAN, Ada, Ruby, ASP, C, C++, Java, Lua, and the list goes on.
Programming languages often have syntax that is easily read by humans (well, at least programmers), often using English words and various symbols such as brackets and parentheses. Some languages like Visual Basic use lots of English words and few symbols. Here is a short example:
Visual Basic Code
Public Function total(a ByVal As Integer, b ByVal As Integer) As Integer
Return a+b
End Function
This function takes two parameters (named a and b) which are both integers (whole numbers), and returns their sum. We’ll learn more about functions and variables in later lessons. This snippets are just for comparison. As you can see, the only symbols we have here are parentheses and a plus sign. Everything else is English words. You could read this as a sentence:
Public function total, takes variable “a” by value as an integer and variable “b” by value as an integer, and the function acts as an integer. Return a plus b. End the function.
Some of those are still special terms we use in programming, such as return, which we’ll discuss later. However, you can still see that it reads not that unlike English.
The other style that languages like C, PHP, and Javascript use has more symbols in place of words. Here is the same code in Javascript:
Javascript Code
function total(a, b) {
return a+b;
}
As you can see, these languages look a bit more different then English, but once you learn to read them it becomes just as easy. Javascript doesn’t have variable types (like integer), so we don’t have to mention that, but everything else is essentially the same. Here is how you could read it:
The function named total takes parameter a and b. Returns the sum of a plus b.
Also, because of high-level languages amount of abstraction, you can write one program and it can often run on many (or nearly all) platforms. So, you can consider high-level languages to be one program for many devices. It achieves this one to many with the use of compilers or interpreters, which we’ll discuss in our next lesson.
In this lesson we discussed low-level and high-level programming languages and some of the difference between the two. Nowadays, it is rare to use a low-level programming language on a computer itself. You will almost always use a high-level language for our modern computers (meaning, the computers such as those running Windows, Mac, or Linux).
You may however use a low-level language if you ever get into device programming such as creating the code to power a video card, mp3 player, or the like. These will sometimes still use assembly language.
In our next lesson we’ll take a look at the differences between compiled and interpreted (and translated) high-level programming languages.




