Computer Programming and types of Programming Languages

This is an introduction to computer programming and types of programming languages. A computer is a general purpose machines which can perform many computational task now the modern day computers that we have they can perform billions or trillions of calculations within a fraction of second. computer will work on with instructions now the computers that we have they contain a lot of programs in them.

Write First Program in C Language

Computer Programming class, Chapter 1 for Beginners

Different types of Programming Languages

Working of C programming language

There are some programs which will manage the computer hardware resources and they are called as the system programs and there are some programs which will provide specific functionality to a user for example the Notepad, web browser, music player, video player and all these types of programs are called as the application programs.

What is called programming language ?

Now we know that we need to give instructions to the computer so that the computer can work on it now the thing is how we can give the instruction to the computer or in which language we can give the instructions to the computer.
Since this computer is a machine how we can communicate with this machine. The language in which these instructions are written or the language in which this program is written is called as the programming
language.

Why Machine language is Binary ?

There are several types of programming languages. You guys may probably heard that the computers can only understand the binary language. This binary language has only two values. 0 and 1 so in this binary language whatever you want to say has to be in the form of this 0 and 1. now here these computer’s are built in such a way that they can understand or they can recognise the pattern of the zeros and ones and then they can work on it accordingly.

Why we have built the computers to understand this binary language?

That is because this binary language which has only two values is easy to create in the hardware level for example if we have a wire and if the current is flowing through this wire then we can say it is 1 if the current is not flowing then we can say it is zero. so in general we can say that one stands for something which exists and zero stands for something which doesn’t exist so since this binary language is easy to create in the hardware level so the computer is built in the hardware level to recognise this pattern of 0 and 1 and while building the computer for a specific
pattern of 0 and 1 a specific setup operations are defined.

so when the computer will see a specific pattern of 0 and 1 it knows what it has to do. The computers can understand this binary language and this binary language with the computers understand are also called as the machine language.

Types of programming languages

In this modern day, we have a lot of programming languages available. let’s take a look at the types of programming languages. The first type of programming language or the language in which we can communicate with the computer is the language which the computer understands. All of you know that this computer’s can understand this binary language or the machine language which is the combination of zeros and ones. The first type of programming languages is the machine level language And in this machine level language, we have the instructions
in the form of 0 and 1.

Whatever you want to say has to be in the form of zero and one and since the computers are built in such a way that they can recognize this zeros and ones and perform some specific operation on that the combination of zeros and ones you know we can communicate with his computer in this language.

Problem with machine level language

The problem with this machine level language is in order to program in this machine level language one has to know everything about the computer. so here the programmer is directly dealing with the hardware level so he is directly working on the memory and the data. so the programmer needs to know everything about the computer, computer processor the computer architecture everything about that he has to know and that’s why this machine level language is a bit difficult to learn and also think about this let’s say you want to write a program in the machine level language or you want to give instructions to the computer.

In the machine level language and your program consists of thousand lines. all your instruction will contain this 0 and 1 and this combination of the zeros and ones. First of all, it is difficult to write the program and also if you make some mistakes in your program then it is difficult to spot and because of all these, a normal guy can’t really learn to programme easily.

To solve these kinds of problems another type of programming languages were invented and they are called as the Assembly level language.

Assembly level language

In this assembly level language instead of that zeros and one’s combination, mnemonic the symbolic codes were introduced. for example, if the programmer has to write an instruction. let’s say he wants to add the numbers 5 and
6. Then in the machine level language, it has to be in the form of this zeros and ones. so let’s say this is gonna be the instruction to add the numbers 5 and 6.

In the machine level language it will look like this but in the Assembly level language mnemonic codes for used and the programmer could write ADD 5 6. So a lot of mnemonics or the symbolic codes where used and the programmer could write the program in this way.

It was a lot more human readable format the programmer can understand the code just by looking at it and it was a lot easier to code than the machine level language. so now the thing is the source code of the program written in this assembly level language by using this mnemonic or the symbol Codes cannot be directly executed in this computer that is because this computer can only understand the machine language.

What is an Assembler ?

What we have to do is we have to convert the code which is written in the Assembly level language to machine level language so that the computer can understand it and execute it. so the program is written in the Assembly level language needs to be converted to the machine level language and to convert that a program was used and that program is called as the assembler.

This assembler will convert the code written in the Assembly level language to machine level language. This assembly level language was the lot easier to learn and someone can learn programming a lot more easily than the machine level language but this assembly level language also had the same difficulties.

although it was a lot easy to write the programs than the machine level language in assembly level language if the program size increases then again it is difficult to spot the errors and also the code written in the Assembly level language was also Computer Architecture dependent. so the code return for one type of computer cannot be executed in another type of computer which has different architecture so again to solve these kind of problems a new types of languages by invented so that a lot more people can come and write the programs and that type of programming languages are called as the Higher level languages.

High level languages

The high-level languages are designed in such a way that they are very easy for a beginner to learn and they were very close to the human-readable language for example in this higher level language one could write the instruction to add 5 and 6 like this.  This 5 + 6 is a lot more similar to the human language so just by looking at the code one can understand what we’re trying to do and since this higher level language was a lot more easy to learn many people started learning computer programming and started creating lot more programs.

Now again the thing is the program written in the higher level language cannot be directly executed in the computer that is because the computer can only understand the machine language which can contain 0 and 1 but the higher level language is very close to the human languages.  so we have to convert the program which is written in the high-level language to machine language which the computers can understand and execute.

For this high-level languages, there are two ways in which we can convert the source code from high-level language to machine level language and execute it and the two methods which were used to convert the high-level language program to machine level language one was the compilation method where a program called compiler was used.

Compiler or Interpreter

This is the compilation method another method is called as the interpretation and for this interpretation method another type of program called an interpreter was used and we will see the details of this compilation and interpretation method a bit later but here just remember that although these are two different methods what they do is they convert the program which is written in the high-level language to machine level language which the computers can understand and execute. This machine level language and the Assembly level language they are called as the lower level languages.

Why are machine level language and the Assembly level language called lower level languages?

Because while writing the programs in this machine and assembly level language the programmers could easily access the computer memory and directly work with the data. but with the most of this high-level languages, the programmers can’t directly access the memory and the work with data.

Middle-level languages

But there are some languages in the high-level language type which allow the programmer to work with the Computer memory and the data and they are called as the middle-level languages. and this middle-level language they provide all the features of the higher level languages and also they allow the programmer to work with the Computer memory and data directly and since this languages provide the feature of the lower level language and also the high-level language they are called as the middle-level languages and we have the languages like C and C plus plus are these are all the middle-level languages because allow the programmer to work with the Computer memory and data and also they provide all the features of this high-level language and in the high-level languages we have Java C Sharp python etc.

Machine level language which is very close to the machine or you know this language the computer directly understands, it executes much faster than all these languages. so the execution speed of this machine language
is very high and after this machine level language we have the Assembly languages and their execution speed is better than the high-level languages but a bit slower than the machine level language and then we have the high-level languages.

Methods to convert higher level language to machine code

As I said before in this high-level languages we can convert the code from higher level language to machine code in two different ways one is the compilation method another one is interpretation method. let’s see this compilation and interpretation method in detail.

In the compilation method a program called compiler is used and this compiler Will take the high-level language program and it will convert that to the machine language and this process is called as the compilation method and here what happens is this compiler will read the high-level language program let’s say this is high-level language program it will read this program and it will convert that to the machine language. it will convert this entire program into machine language and then this machine language code will be executed. The thing is compiler will convert entire program which is written in the high-level language to machine level language and then that machine level language code will be executed.

let’s take a look at this interpretation method so here also we will be converting the program written in the high-level language to the machine level language and then executing that. and for that purpose, we will be using a program called as the interpreter and this process is called as the interpretation. The process of converting the high-level
language program to machine language by using the program interpreter is called as the interpretation method now here what happens is lets say this is the source code or the programs written in the high-level language and this interpreter what it does is first it will read the first line of this source code or the program which is in the high-level language and then it will convert that to the machine code and then it will execute it immediately and after
that it will go to the next line of the high-level language program it will read that it will convert that code and then it will execute it immediately and then it will go to the third line and then again it will convert that code and then it will execute it.

How do the compiler and interpreter work?

In the compilation process the entire program which was written in the high-level language was read first then it was converted to machine level language and then that entire program was executed at once but with the interpretation
method the interpreter will read the program which is in the high-level language line by line it and it will convert and execute each line immediately at a time. and this is how the compiler and interpreter work.

There are many languages in the high-level language type and in that languages some follow the compilation method and some follow the interpretation method. The languages which follow the compilation method are called as the compiled languages  and for example we have C, C + + etc these are all the compiled languages where the compilation  method is used to convert the program in which is written in these languages to the machine  language and the higher level languages which follow the interpretation method are called as the interpreted languages for example we have Python and this Python is an interpreted language.

Alright, that’s it from the introduction to Computer Programming and types of Programming Languages.

The key point for Absolute Beginners in Programming :

This is about the introduction to the Computer programming and types of programming languages, what is its history and why you should study this C programming language. Now if you are an absolute beginner and you really don’t know about computer programming and types of programming languages and all these things, Then its good to read a book called ” Programming in ANSI C ” edition seven by Mac graw hills. Click here buy it from Amazon

Comments

comments