1.3. Programming Languages

What can computers do for you?  Computers can execute tasks very rapidly, but in order to achieve this they need an accurate description of the task. They can handle a greater amount of input data than you can. But they can not design a strategy to solve problems for you. So if you can not figure out the procedure that solve your problem computers cannot help you.

The Computers own language.  Computers do not understand any of the natural languages such as English, French or German. Their proper language, also called machine language, is only composed of two symbols “0” and “1”, or power “on” - “off”. They have a sort of a dictionary containing all valid words of this language. These words are the basic instructions, such as “add 1 to some number”, “are two values the same” or “copy a byte of memory to another place”. The execution of these basic instructions are encoded by hardware components of the processor.

Programming languages.  Programming languages belongs to the group of formal languages. Some other examples of formal languages are the system of mathematical expressions or the languages chemists use to describe molecules. They have been invented as intermediate abstraction level between humans and computers.

Why do not use natural languages as programming languages?  Programming languages are design to prevent problems occurring with natural language.

Ambiguity
Natural languages are full of ambiguities and we need the context of a word in order to choose the appropriate meaning. “minute” for example is used as a unit of time as a noun, but means tiny as adjective: only the context would distinguish the meaning.
Redundancy
Natural languages are full of redundancy helping to solve ambiguity problems and to minimize misunderstandings. When you say “We are playing tennis at the moment.”, “at the moment” is not really necessary but underlines that it is happening now.
Literacy
Natural languages are full of idioms and metaphors. The most popular in English is probably “It rains cats and dogs.”. Besides, this can be very complicated even if you speak a foreign language very well.
Programming languages are foreign languages for computers. Therefore you need a program that translates your source code into the machine language. Programming languages are voluntarily unambiguous, nearly context free and non-redundant, in order to prevent errors in the translation process.

History of programming languages.  It is instructive to try to communicate with a computer in its own language. This let you learn a lot about how processors work. However, in order to do this, you will have to manipulate only 0's and 1's. You will need a good memory, but probably you would never try to write a program solving real world problems at this basic level of machine code.

Because humans have difficulties to understand, analyze and extract information from sequences of zeroes and ones, they have written a language called Assembler that maps the instruction words to synonyms that give an idea of what the instruction does, so for instance 0001 became add. Assembler increased the legibility of the code, but the instruction set remained basic and depended on the hardware of the computer.

In order to write algorithms for solving more complex problems, there was a need for machine independent higher level programming languages with a more elaborated instruction set than the low level Assembler. The first ones were Fortran and C and a lot more have been invented right now. A short history of a subset of programming languages is shown in Figure 1.1.

Figure 1.1. History of programming languages(Source)