Generation of Programming Languages
There are five generations of programming languages. They are:
- First Generation Languages
- Second Generation Languages
- Third Generation Languages
- Forth Generation Languages
- Fifth Generation Languages
Well…there’s no confusion here! You don’t have to give me that look. I will explain everything one by one.
First take a look at the below figure.
Programming languages are categorized into 2 categories. They are, Low level programming languages and High level programming languages.
What are Low level programming languages? A Low Level programming language, is often known as computer’s native language, which is very close to actual machine instructions.
What are High level programming languages? A High Level programming language enables a programmer to write programs that are more or less independent of a particular type of computer. They are closer to human languages and further from machine languages.
I know! I know! Simple as that! Now the foundation is layered. Let’s get to the generations one-by-one. Hopefully the smile will not fade away…
First Generation Programming Languages:
As you can see in the figure, they are low-level languages. These are called Machine Languages or 1G Languages. They are machine-independent. We all know that computers can understand only binary language. Therefore, these are written in binary code, which means this language is written only using 0s and 1s.
Advantages:
- No translator is required. Well, why we would need a translator anyway? It’s written in binary, so the machine can understand without translating it.
- Fast and efficient. Of course! It does not consume time to translate.
Disadvantages:
- Difficult to understand. Imagine you get an error after running a binary program and how will you find the error in a bunch of 1s and 0s? Oh hell NO!
- Difficult to learn. Again 1s and 0s!
Second Generation Programming Languages:
These are low-level assembly languages which are used in kernels and hardware drives. They are called assembler languages or 2G languages. Assembly language contains human-relatable notations and they are converted into machine language through an assembler.
So basically, an Assembler works as a translator and converts assembly level instructions to machine level instructions.
Here, programmers can write code using symbolic instruction codes that are meaningful shorten forms of words that we use in day-to-day life. These are also known as low-level language.
Advantages:
- It is easier to understand compared to machine language. Of course! What is not easier than a bunch of 1s and 0s?
- Modifications are easy.
- Correction & location of errors are easy. After all they are not just 1s and 0s. So, locating an error would be easier than before.
Disadvantages:
- These languages are machine/architecture-depend. This means that there are different instruction set for different machines. This is annoying right?
- An assembler is needed. That’s something extra!
Third Generation Programming Languages
The third generation languages are called procedural languages or 3GL. Procedural languages use a series of English-like words that human can understand easily, to write instructions. These are called High-Level Programming Language. When these are executed, the instructions in the program are translated into machine language using a Compiler or an Interpreter. Examples? Oh I think you know more than I do! C, PASCAL, FORTON, COBOL, JAVA, etc.
Advantages:
- Lesser number of lines of code compared to 1GL and 2GL. Interesting!
- The English-like words make it a human-understandable language. The more we understand the language, the more easier it becomes to use!
- The interesting one! The same code can be copied to another machine & execute on that machine by using compiler specific to that machine. Which means there will be no different instruction set for different machines. How fun is that!
Disadvantages:
- To translate the code into machine language, a compiler or an interpreter is needed.
- Different machines have to have different compilers.
Tired? Too much? Well, let’s have a little break!
Okay, back to the topic. Three down, 2 to go!
Fourth Generation Programming Languages
The fourth-generation languages are also called non-procedural languages/ 4GL. They consist of statements similar to statements in a human language. Fourth generation languages are commonly used in database programming and scripts. What is the main language you get in to your mind when you hear the word Database? For me, SQL! What else? Foxpro, Focus, Perl, PHP, Python, Ruby, ABAP, etc.
Advantages:
- Easy to understand and learn. I told you! Human-friendly language!
- Takes less time to create applications. Easy to use!
- Less prone to errors.
Disadvantages:
- Memory consumption is high. The more it’s easier to the developer, it gets harder to the machine!
- Has poor control over hardware.
- Less flexible.
Fifth Generation Programming Languages
The fifth generation languages are called 5GL. They are based on the concept of artificial intelligence. OMG Really! AI! It uses the concept that rather than solving a problem algorithmically, an application can be built to solve it based on some constraints, i.e., we make computers learn to solve any problem. Parallel Processing & superconductors are used for this type of language to make real artificial intelligence. Well, AI is a huge topic to talk on a separate day. So let us move one with today’s topic. Examples of fifth generation programming languages are, PROLOG, LISP, etc.
Advantages:
- Machines can make decisions. That’s all AI is about!
- Programmer effort reduces to solve problem. Machine does it!
- Easier than 3GL or 4GL to learn and use. TA-DA!
Disadvantages:
- Complex and long code.
- More resources are required and they are expensive too. That’s the sad part!
And here we are! At the end of the article, with some new knowledge we gathered today.
Always remember, gather as much as knowledge you can coz you never know when you need that knowledge! Good luck and enjoy!