Introduction
Programming languages allow humans to write instructions that a computer can execute. SSC tests the
evolution of these languages, plus the crucial distinction between how compiled and interpreted languages
are translated into machine code.
Generations of Programming Languages
| Generation | Type | Example |
| 1st Generation (1GL) | Machine Language — direct binary code (0s and 1s) | Pure machine code |
| 2nd Generation (2GL) | Assembly Language — uses mnemonics instead of raw binary | Assembly |
| 3rd Generation (3GL) | High-Level Languages — closer to human language, needs translation | C, C++, Java, Python |
| 4th Generation (4GL) | Very high-level, often used for database queries/report generation | SQL |
| 5th Generation (5GL) | Used in AI, based on solving problems using constraints rather than an algorithm | Prolog |
Low-Level vs High-Level Languages
| Feature | Low-Level Language | High-Level Language |
| Closeness to hardware | Very close (machine/assembly) | Far from hardware, closer to human language |
| Ease of writing | Difficult, hardware-specific | Easier to read/write/debug |
| Execution speed | Very fast (direct hardware execution) | Slower (needs translation first) |
| Portability | Not portable across different hardware | Portable across different systems |
Compiler vs Interpreter vs Assembler
Flowchart — How Source Code Becomes Executable
Compiler — translates the ENTIRE program at once into machine code before execution
Interpreter — translates and executes code line-by-line, in real time
↓
Assembler — translates assembly language into machine code
| Feature | Compiler | Interpreter |
| Translation | Whole program at once | Line by line |
| Speed of execution | Faster (already fully translated) | Slower (translates as it runs) |
| Error detection | Shows all errors after compiling the whole program | Stops at the first error encountered |
| Example languages | C, C++ | Python, JavaScript (traditionally) |
📌 Note: Some modern languages (like Java) use a hybrid approach — compiled to intermediate "bytecode," which is then interpreted/JIT-compiled by a virtual machine (JVM) — blurring the classic compiler/interpreter distinction.
Programming Paradigms
| Paradigm | Approach | Example Language |
| Procedural | Sequence of instructions/procedures | C |
| Object-Oriented (OOP) | Organises code around "objects" combining data and behaviour | Java, C++, Python |
| Functional | Treats computation as evaluation of mathematical functions | Haskell |
Key OOP Concepts
| Concept | Meaning |
| Class | A blueprint/template for creating objects |
| Object | An instance of a class |
| Inheritance | A class acquiring properties/behaviours of another (parent) class |
| Polymorphism | The ability of an object/function to take multiple forms |
| Encapsulation | Bundling data and methods together, restricting direct access to some components |
✅ UPSC/SSC Focus: Five generations of programming languages · Low-level vs high-level language trade-offs · Compiler (whole-program) vs interpreter (line-by-line) distinction · Four core OOP concepts (class, object, inheritance, polymorphism, encapsulation).