× Terms of Use Privacy Policy

Take me back!! I want my CSS!! Click me to get back :)

×

READY FOR A NEW CAREER?

But not sure where to start? Find out if a tech career is right for you.

TAKE THE 3-MINUTE QUIZ

Compiling

Compiling is the process of converting source code into something that can run on a computer.

Compiling is the process of converting source code into something that can run on a computer.

Computers really only know how to talk in 1’s and 0’s (a.k.a. binary). When you get down to it, each and every instruction it gets looks something like this:

001110100101100010100010110

Everything from visiting a web page to drawing a picture in Photoshop is just a bunch of 1’s and 0’s to a computer.

When you write a program, though, you write it in a programming language. If I wanted to check if I had enough in my bank account to buy an apple, it might look something like

if (bankAccountBalance < applePrice) {
cout << "You don't have enough money!"
}

This is called the source code, and contains your original, human-readable instructions. Compiling is the process of converting your code into the 1’s and 0’s a computer can understand.

The developer writes all of the code, compiles it into a nice little program, and ships it out into the world. Most every program on your computer, from Solitaire to Firefox, is compiled. It’s a lot like translating books; the original The Girl with the Dragon Tattoo was in Swedish (the source code) and needed to be translated (compiled) into English (binary) before you (the computer) could read it.

Writing a compiler – the piece of software that actually does the compiling – is one of the tougher aspects of computer science. It has to be sure it understands the source code you wrote, catch any errors you’ve made in programming, and then spit something out that will work just right on your machine.

But lucky us, we don’t have to write the compiler, we just have to use it! Compilers are programs just like any other on your computer, and all it takes is typing a command or two to package up your code into a nice, machine-readable format.

Cocktail Party Fact

Many compilers are written in the language that they compile! GCC can compile C and C++ and is written in C and C++. You usually start off compiling it with a different compiler, but once it’s finished it should be able to take care of itself.

Your email address will not be published.

One сomment

Want more articles like this?

Sign up to get the most recent tech news, tips and career advice.