What is programming language? What its use ? Why should we learn? Lets Know its.
Introduction
Programming language are the language used to communicate to the computer. But wait a sec ? Does not computer understand only machine langauge i.e. 0's and 1's ? That means machine language is only programming langauge ? We have to learn machine language ? Yes, may be if you were lucky enough to born at 18’s.Howerver nowadays technology has become advanced such that you dont have to learn machine language and can program as writing the mathematical and english instruction.For example:-
1
2
3
4
5
a=24
print("Hello World")
if a > 2:
print("a is greter than 2")
Types of programming language
There are many type programming language based on different categories.
On the basis of abstraction
There are two types as:
- High level language
- Low level language
High level langauge
High level language are the abstracted language means machine independent.It enable the programmer to write the code irrespective to the computer architecture.Some of the example are :
- python
- C
- JavaScript
- Java ,etc
Low Level Language
Low Level Language are less abstracted language means machine dependent. Programmer have to write different code according to the computer architecture.
They are:
- Assembly Language
- Machine Language
You may wondering what is
machine dependentandindependent. Why Skipping ? If you dont understand You will later below.
On the basis of compilation process
As we all know computer undertand only machine language and if programmer use programming language like say python then
1
print("Hi")
How computer understand above code and print Hi ?
Here comes the point.In early days people use to program computer using machine language which is very hard and error prone so that better solution is made for ease use.
Solution 1: Why not use mneumonic for representing the operation instead of pure machine code?
With the use of mneumonic it make very easy to code which is called assembly language. However this doesnot solve the problem yet. As time passed many machine are made and each machine have its own set of instruction people have to write different code for different machine. Eventually genius have dig through this problem and indroduced the solution.
Solution 2: Why not write the program in abstract form(
specific syntax) and then convert it into machine code according to machine intended.
Which lead to creation of special program called compiler.
So for now lets learns the type.They are:
- Compiled Language
- Interpreted Language
Compiled Language
As mentioned above compiler is the special type of program which convert the language written in specific language into machine code.Yes that language which compiler convert is called compiled language.Some of them are :
- C
- C++
- Go
- Rust,etc
Interpreted Language
Before learning about intrepreted language, we should know about intrepreter.Interpreter is special program which execute the program written in some language line by line.And the language intrepreter is called intrepreted language.Some of the example are:
- Python
- Javascript,etc
It is executed by the interpreter and doesn’t directly run in machine so,it tends to be slower than compiled language.Then why is it introduced in first hand if it is slow ? Its because inspite of its abstraction,at the end it is converted into machine code (machine dependent) i.e the code compiled in my computer may or maynot work in my client computer so to solve the problem with write once and run anywhere moto its introduced as its program is run by interpreter irrespective of machine.
Every programming language has its own use case, pros and cons. Its programmer choice which and where to use.For more type and info visit https://en.wikipedia.org/wiki/Programming_language