Search code examples
programming-languages

What's the difference between a low-level, midlevel, and high-level language?


I've heard these terms thrown around describing languages before, like C is not quite a low-level language, C++ is a midlevel, and Python is a high-level language.

I understand that it has to do something with the way the code is compiled, and how it is written. But what defines a language into one of those three categories? Are these absolute categories, or just a general idea programmers use to describe languages to each other?


Solution

  • Yes, they're just general terms. It's to do with abstraction, and how close you are to what the computer's actually doing.

    Here's a list of programming languages ranging from very low to very high level:

    • Machine Code could probably be considered the lowest level programming language.

    • Assembly language is at the level of telling the processor what to do. There is still a conversion step towards machine code.

    • C is a step up from assembler, because you get to specify what you want to do in slightly more abstract terms, but you're still fairly close to the metal.

    • C++ does everything that C can do but adds the capability to abstract things away into classes.

    • Java/C# do similar things to C++ in a way, but without the opportunity to do everything you can do in C (like pointer manipulation in Java's case [thanks Joe!]). They have garbage collection though, which you have to do manually in C++.

    • Python/Ruby are even higher level, and let you forget about a lot of the details that you would need to specify in something like Java or C#.

    • SQL is even higher level (it's declarative). Just say "Give me all the items in the table sorted by age" and it will work out the most efficient way to carry this out for you.