CSS Computer Science (Optional) — Paper-I, Section-A, Topic II subtopic. Appeared as a past paper question (2017).
Classification by Level
- Low-level languages
- Machine language: binary (0s and 1s), directly executed by hardware, no translation needed
- Assembly language: mnemonic codes (e.g.
MOV, ADD), translated by an assembler
- High-level languages
- Human-readable syntax (e.g. C, C++, Java, Python), translated by a compiler or interpreter
- Portable across machine architectures (unlike low-level languages)
Classification by Translation Method
- Compiled languages: entire source translated to machine code before execution (C, C++)
- Interpreted languages: translated and executed line-by-line at runtime (Python, JavaScript classic engines)
- Hybrid (bytecode-based): compiled to intermediate bytecode, then interpreted/JIT-compiled by a virtual machine (Java, C#)
Classification by Paradigm
- Procedural: sequence of instructions/procedures (C, Pascal)
- Object-Oriented: organizes code around objects/classes (C++, Java)
- Functional: computation as evaluation of functions (Haskell, parts of Python)
- Logic-based: facts and rules, inference-driven (Prolog)
- Scripting: lightweight, often interpreted, used for automation/glue code (Bash, Python, JavaScript)
Classification by Generation
| Generation |
Description |
Example |
| 1GL |
Machine language — raw binary |
Direct 0/1 instructions |
| 2GL |
Assembly language — mnemonics |
MASM, NASM |
| 3GL |
High-level, procedural |
C, Pascal, FORTRAN |
| 4GL |
Closer to human language, often domain-specific (e.g. database queries) |
SQL |
| 5GL |
Constraint/goal-based, AI-oriented — program describes the problem, not the steps |
Prolog |
💻 Code Examples: C & C++
The same problem (represent a point and print it) written procedurally in C vs object-oriented in C++ — both are compiled, 3GL, high-level languages, but the paradigm differs:
C (procedural — data and functions are separate):
#include <stdio.h>
struct Point { int x, y; };
void printPoint(struct Point p) {
printf("(%d, %d)\n", p.x, p.y);
}
int main(void) {
struct Point p1 = {3, 4};
printPoint(p1); // procedural: pass the data to a free-standing function
return 0;
}
// compiled with: gcc file.c -o file