Generations of Programming Languages:
1GL: First Generation Language, machine code.
2GL: Second Generation Language, Assembly language.
3GL: Third Generation Language, high-level languages like C, COBOL, FORTRAN.
4GL: Fourth Generation Language, closer to human language, examples include
SQL, MATLAB.
5GL: Fifth Generation Language, languages that use artificial intelligence and
machine learning, examples include Prolog.
Low-Level Languages
Examples:
1. Machine Language:
o Directly understood by the computer's hardware.
o Consists of binary code (0s and 1s).
o Example: 10110000 01100001 (represents a machine instruction).
2. Assembly Language:
o A step above machine language.
o Uses mnemonic codes and labels instead of binary.
o Example: MOV AL, 61h (moves the hexadecimal value 61 into the AL
register).
Advantages:
1. Efficiency: Programs run very fast and are highly optimized.
2. Control: Offers precise control over hardware and memory usage.
3. Size: Programs are typically smaller in size.
Disadvantages:
1. Complexity: Difficult to learn and use due to its detailed nature.
2. Portability: Not portable; code written for one type of hardware may not run on
another.
3. Development Time: Takes longer to write and debug.
High-Level Languages
Examples:
1. Python:
o General-purpose language with easy-to-read syntax.
o Example: print("Hello, World!")
2. Java:
o Object-oriented language that is platform-independent.
o Example: System.out.println("Hello, World!");
3. C++:
o Combines procedural and object-oriented programming.
o Example: std::cout << "Hello, World!" << std::endl;
Advantages:
1. Ease of Use: Easier to learn and write due to abstraction from hardware details.
2. Portability: Code can run on different platforms with little or no modification.
3. Development Speed: Faster development and debugging process.
Disadvantages:
1. Performance: Generally slower than low-level languages due to additional layers of
abstraction.
2. Less Control: Limited control over hardware and memory management.
3. Resource Consumption: High-level languages may consume more resources due to
overheads.
Summary
Low-Level Languages: Machine Language and Assembly Language; offer efficiency
and control but are complex and not portable.
High-Level Languages: Python, Java, and C++; provide ease of use and portability
but may sacrifice performance and control.