What You Need To Know:
Low level refers to code written directly for the computer – ie. Machine Code and Assembly
Is C a Low Level Language? Opinions are mixed!
Why Low Level? Understanding low level programming is key if you want to work in Machine Learning or the Internet of Things. On top of that, understanding what’s going on under the hood makes anyone a better developer.
Olivier is a mentor at Holberton School where he helps students when they have questions related to low level programming. He’s also the Chief Software Architect at FutureOn in the oil industry. In the past, he’s lead the development of GIS (mapping) libraries for mobile and built video games like Age of Conan.
Arthur Damm spent 7 years working as a private tutor in math, science, and programming (and had a year-long technical intern gig developing Java Android). Arthur chose Holberton School because of the accessibility of the ISA, the cool San Francisco campus, and a rigorous full-stack curriculum (which of course includes low-level programming). Arthur is currently in the final Specialization phase of Holberton School.
Arthur: In modern times, low level programming is any language in which you handle memory management. Any language where that memory management or garbage collection is done for you, which is now most languages, is considered “high level.”
Olivier: Low level programming is basically everything that is close to the hardware you are running your code on. It can have different meanings depending on your target. If you construct a building, you always start with the foundation and build on top of that. Low level development is that foundation – if you start with high level programming, then you don’t understand what’s going on underneath.
Pro Tip: Garbage Collection is when the system cleans up for you. In C programming, you have to clean up after yourself.
Arthur: In the old days, C was considered a high-level language. Today, many engineers might laugh at that because C is so low level. C and C++ are now considered low-level languages because they have no automatic memory management.
Olivier: The definition of low level has changed quite a bit since the inception of computer science. I would not qualify C as a low or high level language, but rather more like an intermediary language. The only true low level programming is machine code or assembly (asm). Assembly is as close as possible to what the CPU (the computer's processor) can execute, as it is literally a text translation of the binary code which the CPU understands. For example, compression libraries are typically built in C, and very specific parts would be built using assembly, but the amount of assembly is getting lesser because compilers are getting so much better at optimization.
Arthur: I consider C a low-level language nowadays. Certainly, it is the primary language that Holberton uses in the low-level curriculum. So for me C is low level because when using it we have to manage our own application memory, it is not managed for us by the language. This requires us as engineers to take total responsibility for our actions. This means our mistakes will tend to be catastrophic but the rewards are substantial in terms of efficiency and power consumption on whatever device runs our code. Also, being a C programmer can be inherently satisfying if you like to understand the technical details of your work.
Olivier: Generally speaking, high level means that you can use a lot of abstraction to accomplish what you want to do. In low level, you will only have a standard set of functions. Low level languages also give you a lot of freedom.
Examples of High Level Languages:
Pro Tip: When you want to add new features to Python, that's called an extension. And those are actually written in C! For some of Holberton’s advanced assignments, students actually write the C code that goes underneath Python, and then test them together to see it working.
If most high-level languages are doing memory management and garbage collection for you, then what's the point of knowing low-level programming?
Arthur: In engineering, there are no perfect solutions. There are only trade-offs. When a language handles memory management, it’s way easier for the engineer to work. Your messes are cleaned up for you. However, the trade-off is that this generally creates less efficient code, which is more computationally intensive. Practically, that means it will cost more power on a cell phone, laptop, smart sensors, or components in a smart appliance. The amount of energy a device uses is actually very important in embedded systems and in wearables.
Low level programming becomes especially important in the Internet of Things (IoT) and wearable devices, where efficiency in power consumption is actually the most important consideration.
Secondly, all of the high-level languages are built off of low-level languages. You’ll need low-level programming to sustain and keep developing those high-level languages.
Olivier: While there is a big push to be able to use high level language to be able to write low level things like drivers for graphics cards, low level languages are still needed for performance. For example, everything relating to encoding or decoding and encryption will probably use low level programming, with C and probably some assembly to use extended instruction (like AVX, SSE, etc). Basically, everything that needs high-performance and fine tuning will require a bit of low level programming.
Olivier: Any job related to embedded software development, and building code that needs to run fast. If you understand low level programming, you will probably understand anything that goes above. When I’m recruiting and the applicant gets stuck on a React problem, I want to see that the developer is able to read code and understand what the library is doing.
Also, if you want to work in GPU programming using “high level” languages like CUDA or OpenCL, you’ll need to understand low level programming. In GPU (graphical process unit), everything is massively parallel and the way you format your memory is actually as important as the actual code.
Arthur: I'll be looking for jobs in the Internet of Things or embedded systems. My goal is to work on an interesting project and, of course, to apply my low-level C programming skills.
But I’ve really grown to appreciate the idea of Holberton School – they’re an alternative to a traditional four-year computer science degree, which is inherently a more rigorous and technical level of engineer. In that case, I think starting with C is ideal, because it requires you to understand all the details in a very relevant way. For example, by learning C first, we actually become much more capable when we move on to Python.
Olivier: If you want to improve your skills as a developer, you need to understand how the computer is working, even when the details are hidden from you. If you learn how to program in C first, then you will have a much easier time with high level languages later on.
Do you need to know math for low level programming?
Arthur: Computer science breaks down into numbers, so we can't get away from math in low-level programming. You should become familiar with advanced algebra. You won't need calculus-level mathematics, but you will need at least full high school mathematics when you're dealing with certain problems as a low level engineer.
Low Level Programming at Holberton School
Arthur: Our first nine months (called Foundations) is a full stack curriculum, meaning we learn low-level and high-level languages. Foundations are an excellent general introduction to all layers of the stack, that is: low-level, high-level, devops, databases, and portfolio projects. We learn almost exactly three months of C programming. And then in Specialization we pick up wherever we left off in that part of the Foundations stack. In my case we continued with technical systems programming in the low-level C language. So we learn how to write our code in the way that is written for Linux, which is considered the standard operating system of the engineering world.
Olivier: The foundation of C is important, because it gives Holberton students the base to build upon. If you know C, there is a high probability that you will be able to understand any imperative language thrown at you. As a plus, you will understand how memory works. Holberton School’s 9 month specialization is basically a condensed kickstarter to help you become better faster in the branch of computer science you like.
Example of a Low Level Programming Project
Arthur: For the most part so far, we've been replicating components that exist in the Linux operating system. Linux is considered a work of engineering art. Currently, we're working on the shell or the command line. That involves quite a bit of advanced system programming.
At Holberton, although we don't have instructors teaching us on a regular basis, we are assigned projects with automated testing, and this is one of the projects. Then, later on, we will have our own portfolio projects where we get to choose what we would like to create.
For our weekly algorithm practice, we recently studied a very interesting pattern matching algorithm called the KMP, Knuth–Morris–Pratt substring-search. It's really technical, but also surprisingly accessible. I always get a little mental buzz when I first learn a new algorithm and really start to understand it.
How can someone get started in Low Level Programming?
Olivier: We are lucky to live in a time where information is everywhere. I recommend a book called The C Programming Language by Dennis M. Ritchie and Brian W. Kernighan (the creators of C).
My advice to every student is to read code! In the beginning, this is hard, but you’ll become better at it. My foundations in C have helped me so much over the years.
All the coding bootcamp news you may have missed in June.
Data expert (and General Assembly instructor) Craig Fryar's Intro to Data Visualization with Tableau
Bootcampers graduate with solid portfolios – let's take a look at 5 of those Python projects!