Code and Its “Translator”: Compiler & Interpreter

Code

The first thing we need to learn about programming is code. You may be confused about if there is any difference between coding and programming. In fact, coding is just one part of programming, which includes designing algorithm, coding and so on.

Just like there are different languages in the world, there are various programming languages, like Python, Java, C and so on. Coding means that we use these programming languages to write instructions that enable our devices to perform specific tasks, thereby reducing our workload.

Compiler & Interpreter

You might wonder why all the applications on my computer appear in the same format (EXE files). This is because computers cannot directly understand programming languages. Regardless of which language we use, we need a “translator” to convert our code into a form the computer can understand, which we call a “compiler” or “interpreter”.

A compiler works like document translation: it reads our entire code file and translates it into an executable file (like an EXE file). An interpreter, on the other hand, is more like real-time speech translation: as you write each line of code, the interpreter translates it immediately for the machine to execute before moving to the next line.

Therefore, when learning a programming language, the first step is to download a compiler or an interpreter for that language, which will enable our device to understand our instructions. Generally, all programming languages have both compilers and interpreters; the only question is which one we use more frequently during development. Once development is complete, we can use the compiler to package our code into an executable file for distribution.

Leave a Comment