Computer Operator and other IT papers in Lok Sewa regularly ask about generations of programming languages, the difference between a compiler and an interpreter, who made C or Java, and what each flowchart symbol means. This note explains these topics in simple language, with tables to help you revise quickly before the exam.
1. Program, programmer and programming language
A program is a set of step-by-step instructions given to a computer to do a task. Writing programs is called programming, and the person who writes them is a programmer. A collection of programs with their documentation is software.
A programming language is a formal language with its own words and grammar (syntax) used to write programs. The instructions written by the programmer are called source code. After translation into machine language, it becomes object code (machine code). Ada Lovelace is called the first computer programmer because she wrote an algorithm for Charles Babbage’s Analytical Engine in the 1840s.
2. Generations of programming languages
| Generation | Language type | Main features |
|---|---|---|
| First (1GL) | Machine language | Written in binary 0 and 1; understood directly by the CPU, so no translator is needed; fastest, but very hard to write and machine dependent |
| Second (2GL) | Assembly language | Uses short words called mnemonics such as ADD, SUB and MOV; needs an assembler; still machine dependent |
| Third (3GL) | High-level language | English-like statements; machine independent (portable); needs a compiler or interpreter. Examples: FORTRAN, COBOL, BASIC, Pascal, C, C++, Java |
| Fourth (4GL) | Very high-level or non-procedural language | The user says what is wanted, not how to do it; used for databases and reports. Example: SQL |
| Fifth (5GL) | Natural and logic languages | Used in artificial intelligence and expert systems; the programmer gives rules and constraints. Examples: Prolog, Mercury |
Machine and assembly languages are called low-level languages because they are close to the hardware. Languages from the third generation onwards are high-level languages because they are close to human language.
3. Language translators
A computer understands only machine language, so every other program must be translated. A language translator is system software that does this job.
| Point | Assembler | Compiler | Interpreter |
|---|---|---|---|
| Translates | Assembly language into machine code | Whole high-level program at once | High-level program one line (statement) at a time |
| Object code | Produced | Produced and saved, so the program can run again without translating | Not saved; translated every time it runs |
| Speed of running | Fast | Fast | Slower |
| Error reporting | Shows errors after translation | Lists errors after checking the whole program | Stops at the first error line, so debugging is easier |
| Examples | Used for assembly programs | C, C++, FORTRAN, COBOL | BASIC (classic), Python, JavaScript |
- Linker: joins object code files and library files into one executable program.
- Loader: loads the executable program into main memory (RAM) to run it.
- Java is first compiled into bytecode, which the Java Virtual Machine (JVM) then runs on any computer. This is why Java is called ‘write once, run anywhere’.
4. Famous programming languages and their makers
| Language | Year | Developer | Notes |
|---|---|---|---|
| FORTRAN (FORmula TRANslation) | 1957 | John Backus and team, IBM | First widely used high-level language; for science and engineering |
| COBOL (COmmon Business Oriented Language) | 1959 | Committee (CODASYL); Grace Hopper’s work was a major influence | For business and government data processing |
| BASIC (Beginner’s All-purpose Symbolic Instruction Code) | 1964 | John Kemeny and Thomas Kurtz | Easy language for beginners |
| Pascal | 1970 | Niklaus Wirth | For teaching structured programming |
| C | 1972 | Dennis Ritchie, Bell Labs | Used to write the UNIX operating system; called the mother of modern languages |
| C++ | 1980s (name from 1983) | Bjarne Stroustrup | C with object-oriented features |
| Python | 1991 | Guido van Rossum | Simple, readable; popular in AI and data science |
| Java | 1995 | James Gosling, Sun Microsystems | Platform independent through the JVM |
| JavaScript | 1995 | Brendan Eich, Netscape | Makes web pages interactive |
| PHP | 1995 | Rasmus Lerdorf | Server-side web programming |
HTML (HyperText Markup Language), created by Tim Berners-Lee, is a markup language for designing web pages, not a full programming language. SQL (Structured Query Language) is used to work with databases. LISP and Prolog are used in artificial intelligence.
5. Programming approaches
- Procedural or structured programming: the program is divided into procedures or functions and works step by step, usually designed top-down. Examples: C, Pascal, FORTRAN.
- Object-oriented programming (OOP): the program is built from objects, which combine data and functions. A class is a blueprint and an object is an instance of a class. Examples: C++, Java, Python, C#.
- Main OOP features: encapsulation (wrapping data and functions together and hiding data), inheritance (a new class gets the features of an old class), polymorphism (one name, many forms) and abstraction (showing only essential details).
- Every structured program uses three basic control structures: sequence (one step after another), selection (decision, such as IF … ELSE) and iteration (loops, such as FOR and WHILE).
6. Algorithm
An algorithm is a finite, step-by-step procedure written in simple language to solve a problem. The word comes from the name of the Persian mathematician al-Khwarizmi. An algorithm written in a form close to program code is called pseudocode.
- Input: it takes zero or more inputs.
- Output: it gives at least one result.
- Definiteness: each step is clear and has only one meaning.
- Finiteness: it must end after a limited number of steps.
- Effectiveness: each step is simple enough to be carried out.
Example algorithm to find the larger of two numbers: Step 1: Start. Step 2: Read A and B. Step 3: If A is greater than B, print A; otherwise print B. Step 4: Stop.
7. Flowchart and its symbols
A flowchart is a diagram that shows the steps of an algorithm using standard symbols joined by arrows. It makes the logic easy to understand, check and explain.
| Symbol (shape) | Name | Use |
|---|---|---|
| Oval or rounded rectangle | Terminal | Start or Stop (beginning and end) |
| Parallelogram (slanted rectangle) | Input/Output | Read data or print results |
| Rectangle | Process | Calculation or assignment, such as Sum = A + B |
| Diamond (rhombus) | Decision | A question with Yes or No (True or False) branches |
| Arrow lines | Flow lines | Show the direction of flow from one step to the next |
| Small circle | On-page connector | Joins parts of a flowchart on the same page |
| Pentagon shaped like a home plate | Off-page connector | Continues the flowchart on another page |
| Rectangle with double lines on both sides | Predefined process | A sub-program or function defined elsewhere |
Rules: a flowchart has one Start and at least one Stop; flow usually goes from top to bottom and left to right; a decision box has one entry and two or more exits; flow lines should not cross where it can be avoided.
8. Errors, debugging and the program development life cycle
| Error | Meaning | Example |
|---|---|---|
| Syntax error | Breaking the grammar rules of the language; found by the compiler or interpreter | Missing semicolon or misspelled keyword in C |
| Logical error | The program runs but gives the wrong answer; hardest to find because no error message appears | Using + instead of × in a formula |
| Runtime error | Error that happens while the program is running | Dividing a number by zero, or running out of memory |
A mistake in a program is called a bug, and finding and removing it is debugging. The term became popular after Grace Hopper‘s team found a moth stuck in the Harvard Mark II computer in 1947.
Program Development Life Cycle: problem analysis, then design (algorithm and flowchart), coding, testing and debugging, implementation, documentation, and maintenance. Documentation is the written description that helps users and other programmers understand the program.
📌 Key points to remember
- A program is a set of instructions; source code is translated into object (machine) code.
- 1GL machine language (0 and 1), 2GL assembly (mnemonics), 3GL high-level (C, Java), 4GL SQL, 5GL Prolog (AI).
- Assembler: assembly to machine code. Compiler: whole program at once, faster. Interpreter: line by line, easier debugging.
- FORTRAN 1957 John Backus; C 1972 Dennis Ritchie; C++ Bjarne Stroustrup; Java 1995 James Gosling; Python Guido van Rossum.
- Ada Lovelace is called the first programmer; HTML is a markup language, not a programming language.
- OOP features: class, object, encapsulation, inheritance, polymorphism and abstraction.
- An algorithm must have input, output, definiteness, finiteness and effectiveness.
- Flowchart: oval = start or stop, parallelogram = input or output, rectangle = process, diamond = decision, circle = connector.
- Syntax errors are found by the translator; logical errors give wrong output; runtime errors occur while running.
Test yourself: Programming Languages, Translators and Algorithms
Practise Program, programmer and programming language, Programming approaches and Errors, debugging and the program development life cycle with 20 questions.