Beginner Guide to learn Coding (part 2)

guide, beginner

Hi guys, I\’m back to continue the next steps of the guide… step 2

Step 2: How programming languages actually work?

In previous section, we learned about computes basics such as CPU, RAM and set of instructions in form of 1 and 0. Theoretically, we can write code telling computer what to do, by stringing the sequences of 0 and 1 in the way that computer can understand. Writing sequence of zero and one like this is to write machine code.

This sounds horrible, right? Actually, it\’s not that terrible. High level programming languages like Javascript, Python or Java did give developers easy ways to write code without those 0 and 1 sequences. Each of them provide a set of human-readable keywords, statements, and syntax rules that are much easier for developers to work with. We\’re happy, right? xD

Programming languages provide a way to bridge the gap difference between the way our human brains understand the world and the way computer brains (CPUs) understand the world. Then, the codes that we write need to be translated into the binary instructions (machine code) that the CPU understands.

Depending on the programming language, we can say that your code is either compiled or interpreted into machine code. These codes are capable of being executed by your computer CPUs. Most programming languages include a program called a compiler or an interpreter which performs this translation steps. Either compiled or interpreted language did provide developers many different ways to handle error, performance, etc.

For instance, JavaScript and Python are interpreted languages while Java is a compiled language.

In more details example:

The programmer/developer writes instructions in the selected higher level language (Java here), and these instructions or source code are stored in text form in a file. This source file is then passed to a program called a compiler to translate the source language to object code in binary form and writes that to another file called the program.

An example is an .exe file on Windows. There may be an additional step called linking which is the process of combining the programmers instructions with libraries of instructions created by someone else. Sometimes the program file may be sent to another computer for execution. This is called deploying.

When the program is run by the computer, the computers OS (operating system) opens the program file, reads and executes the binary instructions it finds.

Great, we\’re at the end of step 2. To summarize this step, we learned basics about programming language in order to understand lower and higher levels of programming instructions. We also have some ideas about compilers, compiling, interpreter, linking and deployment.

Stay tuned for step 3! Don\’t give up, more interesting things are coming!

Leave a Comment

Your email address will not be published. Required fields are marked *