Computer Programming: Chapter: 02 – Know the Basics

In the previous article Computer Programming: Chapter: 01 – Introduction, I spoke about what is programming and ended it by saying that computers do not understand English or for that matter any language we humans speak. I said that computers only understand the language of 0’s and 1’s.

If you have used a computer for any purpose till now, you will not agree with me, since you have been using it mostly in English or any other language that you know. You would have watched movies, listened to songs, created documents, sent e-mails, browsed lot of sites and even you would have read my articles in one of the human readable languages. Also if you have written a program or even seen somebody doing it, you might have noticed that even they have not been using the language of 0’s and 1’s.

Even if you agree that there are people who knows this language of 0’s and 1’s, looking at the second important point I said that “The instructions should be PRECISE”, you might be wondering that it will be next to impossible to even write a simple computer program, if what I am saying is true.

Today, to use a computer you need not know how a computer works or what language does it speak? All you need to do is simply turn on a computer and when it is ready use the mouse and keyboard to point at some little graphical object on the screen, click a button, Swipe a finger or two in case of a touch screen device to get a computer to do what is required of it. An example would be what you need to read this article.

The reason computers are so easy to use today because of the hard work of some programmers who have programmed for it to behave in a certain way. And, here we are not trying to use a computer, but to learn how to program a computer. But the computer doesn’t know anything except 0’s & 1’s called binary language, and remember not all computers speak the same dialect. That is the reason a program on a desktop computer does not run on an iMac and vice versa.

Let me explain with an example of two blind people, where in the first person (let us call him as Person-A) knows only English and the other person (let us call him as Person-B) knows only Sanskrit. Person-A wants Person-B to draw a sketch? Now, how do you expect these two to communicate with each other, isn’t it difficult. Person-A can’t even show in writing since the Person-B being blind. The only way of communicating is through speech in a known language, and by giving precise instructions.

Now, the only way they both can communicate with each other is by having an interpreter. Now when the Person-A speaks in English, the interpreter then translates it into Sanskrit and repeats it to the Person-B. When the Person-B says something in Sanskrit, the interpreter again translates and repeats the sentence in English to the Person-A. Now with the help of interpreter, both are able to communicate very easily.

By using the interpreter solves our language problem. We still have another problem at our hand. That is Person-A is asking Person-B who is blind to draw a sketch. Though this is not something that is impossible, but it is difficult, unless you know how to instruct. Even if Person-A is able to now communicate, he should know the steps in a proper order and very precisely, otherwise he will get Person-B to draw something, but not what he would be expecting. Person-A should know every minute detail very precisely, since the Person-B is blind, he will just follow whatever Person-A instructs. If the Person-A asks him to draw a line of 1.23 cm, from a particular point with a certain degree, Person-B without even questioning anything just does that without even thinking about the outcome. If Person-A knows how to instruct precisely and exactly in the way it is required, then Person-B will draw what he wants in the way he wants.

If we get back to computer programs, and use the same approach as in the above example everything becomes very simple and easy. Replace Person-A with yourself and Person-B with the computer. Now the first thing you need is an interpreter and the second is you should know what you want and the precise steps that is required, so that you can get the work done.

To Read or Write a Binary code or program is unfortunately very difficult for humans. So we have to use some kind of program that can translate something we instruct in English into Binary language and vice versa. These programs which can translate our instructions in English into Binary code are surprisingly called as an interpreter.

Do these interpreters really understand English?

This will be the question that might be running in your mind now. The answer is Yes & No.

Yes, since we use English words programming languages, and No since computers are still not up to that level so as to understand what we speak be it in any language. This type of language is known as high level languages. By using the term languages, I am not referring to various languages such as English, French, etc., but I am referring to the high level languages that we use to write programs, which are then interpreted and converted into binary code so as to make the computers understand it. High Level languages are covered in more detail in the coming sections.