top of page
Search

What is a high or low-level programming language?

You might have heard of the terms high-level and low-level programming language. If you’re still confused, read on.

In the software development world, we often use high-level and low-level terms. These terms can be applied to many concepts: high-level architecture, low-level programming, high-level estimates etc.

In order to understand what a high-level and low-level programming language is, you’d better understand what high-level and low-level means. I personally, like to think about these terms as different views/perspectives:

  1. imagine you are up in the (clear) sky in a plane. You look down and you clearly distinguish the fields from the rivers/seas/oceans. You might also see different objects: some buildings, roads, cars, boats, football fields, squares etc. You can see them, but you cannot detail them from this point (e.g. you can’t say that’s a Porsche, it’s just a yellow car). You know there are various people, objects, buildings etc. but you don’t have the details. This as a high-level perspective of the world below.

  2. now imagine you are on land in the same place. All of the sudden, you have access to many more details regarding the surrounding objects. You can now distinguish between car brands, multiple shades of the same color, the texture and height of the buildings etc. This is a low-level perspective of the same world.

Now, coming back to the programming languages. Let’s see how the code is actually executed by a computer.

Let’s assume that you, as a programmer, come up with an algorithm and you write it in a form of source code in a programming language. Assuming your code is complete, you might want to build your program. When build starts, the compiler takes the source code (source language) and translates it to machine code (target language). This machine code (also known as binary), is a stream of binary numbers (ones and zeros – 101010101010) which represent CPU instructions having the same meaning you wrote in your source code. Wait, so the computer is NOT executing MY code? It is, but not in the form you wrote it.

So, in order for your code to run, the compiler needs to perform this transformation between your source code and machine code (binary). The closer the programming language is to the machine code, the less (or none) work the compiler needs to make, right? The less work the compiler does, the faster the program is.


How the code runs on a computer


A low-level programming language is one which is closer to machine code Advantages (pros):

  1. might be directly executable (when no compilation is required)

  2. best performance

  3. ideal for fast applications such as: operating systems, firmware

Disadvantages (cons):

  1. difficult to use due to syntax and little to no abstractions

  2. longer development time

A high-level programming language is one which is farther from machine code Advantages (pros):

  1. more abstract

  2. easier to work with

  3. shorter development time

  4. closer to the English language

Disadvantages (cons):

  1. always relies on compiler to be executed

  2. lower performance due to compiler translations

  3. ideal for all other types of applications than the one from the previous example

So how do you know which programming language is low-level and high-level? It’s a relative thing, you need to have another language for comparison. For example, C++ is considered a high-level programming language compared with assembly language, while C# is considered a high-level programming language compared with C++.


Please note that the actual languages abstraction levels displayed above are for didactic purposes only (language abstractions levels are not accurate)


Let’s see some sample source codes:

Each programming language has its advantages and disadvantages. Of course the easiest way is to work with a high-level programming language, like C# or Java.

Usually, (non-technical) people think of programming in terms of a low-level programming languages (like assembly or C++). At first sight, these “gibberish” (programming languages) can be pretty intimidating for anyone, including a beginner programmer.

But things are not as difficult as they might seem. This is why, in the Basic Programming courses, you’ll get to work with a high-level programming language, C# to be precise, which can make the whole programming process easier to understand.

By the way, the C++ and C# code samples, actually solve the same problem. If you were a beginner, which code you’d rather try to understand: C++ or C#? To be fair, the C# code in this example is written in a more organized way. The C++ sample can be improved from this perspective too, but try to compare the two nonetheless.

If you have questions, contact me via Facebook or drop me a line, I’ll follow up on it, I promise.

Comments


bottom of page