Before Knowing that, we have to know the facts about generations of programming languages.
First-generation programming languages:
A first-generation programming language is a machine-level programming language.
Originally, no translator was used to compile or assemble the first-generation language. The first-generation programming instructions were entered through the front panel switches of the computer system.
The main benefit of programming in a first-generation programming language is that the code a user writes can run very fast and efficiently, since it is directly executed by the CPU. However, machine language is a lot more difficult to learn than higher generational programming languages, and it is far more difficult to edit if errors occur. In addition, if instructions need to be added into memory at some location, then all the instructions after the insertion point need to be moved down to make room in memory to accommodate the new instructions. Doing so on a front panel with switches can be very difficult. Furthermore, portability is significantly reduced - in order to transfer code to a different computer it needs to be completely rewritten since the machine language for one computer could be significantly different from another computer. Architectural considerations make portability difficult too. For example, the number of registers on one CPU architecture could differ from those of another.
The distinguishing properties of these first generation programming languages are that:
- The code can be read and written by a programmer. To run on a computer it must be converted into a machine readable form, a process called assembly.
- The language is specific to a particular target machine or family of machines, directly reflecting their characteristics like instruction sets, registers, storage access models, etc., requiring and enabling the programmer to manage their use.
- Some assembler languages provide a macro-facility enabling the development of complex patterns of machine instructions, but these are not considered to change the basic nature of the language.
First-generation languages are sometimes used in kernels and device drivers, but more often find use in extremely intensive processing such as games, video editing, and graphic manipulation/rendering.
Reason for Avoiding :
1. Programs had to be written using binary codes unique to each computer.
2. Programmers had to have a detailed knowledge of the internal operations of the specific type of CPU they
were using.
3. Programming was difficult and error-prone.
4. Programs are not portable to other computers.
Second-generation programming languages:
A second generation (programming) language (2GL) is a grouping of programming languages associated with assembly languages. Unlike the first generation languages, programs can be written symbolically, using English words (also known as mnemonics), in a way that a human can understand and are subsequently converted into machine language by an assembler.
1. Programs had to be written using binary codes unique to each computer.
2. Programmers had to have a detailed knowledge of the internal operations of the specific type of CPU they
were using.
3. Programming was difficult and error-prone.
4. Programs are not portable to other computers.
Second-generation programming languages:
A second generation (programming) language (2GL) is a grouping of programming languages associated with assembly languages. Unlike the first generation languages, programs can be written symbolically, using English words (also known as mnemonics), in a way that a human can understand and are subsequently converted into machine language by an assembler.
Reason for Avoiding :
1. Assembler languages are unique to specific types of computers.
2. Programs are not portable to other computers.
Third-generation programming languages:
A third generation (programming) language (3GL) is a grouping of programming languages that introduced significant enhancements to second generation languages, primarily intended to make the programming language more programmer-friendly.
English words are used to denote variables, programming structures and commands, and Structured Programming is supported by most 3GLs. Commonly known 3GLs are FORTRAN, BASIC, Pascal and the C-family (C, C+, C++, C#, Objective-C) of languages.
Also known as a 3rd generation language, or a high-level programming language.
1. Easier to learn and understand than an assembler language as instructions (statements) that resemble human
language or the standard notation of mathematics.
2. Have less-rigid rules, forms, and syntaxes, so the potential for error is reduced.
3. Are machine-independent programs therefore programs written in a high-level language do not have to be
reprogrammed when a new computer is installed.
4. Programmers do not have to learn a new language for each computer they program.
Disadvantages:
1. Less efficient than assembler language programs and require a greater amount of computer time for
translation into machine instructions.
While comparing to the advantages limitations can be neglected.
Before going deep into JAVA we have to know why Java become most popular than other 3GLs
C :
Advantages:
1. Assembler languages are unique to specific types of computers.
2. Programs are not portable to other computers.
Third-generation programming languages:
A third generation (programming) language (3GL) is a grouping of programming languages that introduced significant enhancements to second generation languages, primarily intended to make the programming language more programmer-friendly.
English words are used to denote variables, programming structures and commands, and Structured Programming is supported by most 3GLs. Commonly known 3GLs are FORTRAN, BASIC, Pascal and the C-family (C, C+, C++, C#, Objective-C) of languages.
Also known as a 3rd generation language, or a high-level programming language.
Moving away from the cryptic commands of Assembly Language and one step below Fourth Generation Languages, programmers in 3GLs are favored by using aggregate data types, variable names and the ability to define sections of code as subroutines. The program in 3GL is called the Source Program or Source Code and it subsequently converted by a specialized program, the Compiler, to Object Code, understandable by the specific computer and CPU.
Since the introduction of the Compiler in 1952, hundreds of 3GLs have been developed, specifically providing benefits for programmers of applications serving various business and scientific domains. In 1957, IBM created FORTRAN (FORmula TRANslator) to facilitate computerized mathematically-intensive scientific research. COBOL (COmmon Business Oriented Language) was instrumental in spurring a surge of programs serving the business arena, with its enhanced ability to provide record keeping and data management services. Most of the general purpose programming languages used today such as C, C++, C# and Java are 3GLs.
Advantages:Since the introduction of the Compiler in 1952, hundreds of 3GLs have been developed, specifically providing benefits for programmers of applications serving various business and scientific domains. In 1957, IBM created FORTRAN (FORmula TRANslator) to facilitate computerized mathematically-intensive scientific research. COBOL (COmmon Business Oriented Language) was instrumental in spurring a surge of programs serving the business arena, with its enhanced ability to provide record keeping and data management services. Most of the general purpose programming languages used today such as C, C++, C# and Java are 3GLs.
1. Easier to learn and understand than an assembler language as instructions (statements) that resemble human
language or the standard notation of mathematics.
2. Have less-rigid rules, forms, and syntaxes, so the potential for error is reduced.
3. Are machine-independent programs therefore programs written in a high-level language do not have to be
reprogrammed when a new computer is installed.
4. Programmers do not have to learn a new language for each computer they program.
Disadvantages:
1. Less efficient than assembler language programs and require a greater amount of computer time for
translation into machine instructions.
While comparing to the advantages limitations can be neglected.
Before going deep into JAVA we have to know why Java become most popular than other 3GLs
C :
Advantages:
1. C is a building block for many other currently known languages. Take a look at Python for
example a fully Object-Oriented High-Level programming language. It is written in C
(perhaps C++ too). That tells you if you ever want to know what is going on under the hood
in other languages; understanding C and how it works is essential.
2. C is a compiled language versus an interpreted language. Explained simply, this means that
the code is compacted into executable instruction (in the case of windows anyway) rather
than being "translated" on the fly at run time. This feature also lends heavily to the speed of
C programs.
3. A lot of libraries are written in C.
4. The main advantages of C language is that there is not much vocabulary to learn, and that
the programmer can arrange for the program is very fast. C programming language is very
easier to learn. C programming language is still a practical and compact language. It
comprises a good semantic. Syntax is of C is clear also. C language is very near to assembly
programming i.e. the hard use of pointers for example is a very powerful mechanism.
5. C has features that allow the programmer to organize programs in a clear, easy, logical way.
For example, C allows meaningful names for variables without any loss of efficiency, yet it
gives a complete freedom of programming style, including flexible ways of making
decisions, and a set of flexible commands for performing tasks repetitively (
decisions, and a set of flexible commands for performing tasks repetitively (
for
, while
, do
).Disadvantages:
1. C does not have OOPS feature that's why C++ is developed. If you know any other modern
programming language then you already know its disadvantages.
2. There is no runtime checking in C language.
3. There is no strict type checking (for ex: we can pass an integer value for the floating
data type).
4. C doesn't have the concept of namespace.
5. C doesn't have the concept of constructors and destructors