Information Technology Topic
Generations of Programming Languages
- Read notes
- Flashcards
- Quiz
- Confident
Study focus - 3 things
- The five generations run from closest to the hardware to closest to human thinking: 1 machine language, 2 assembly language, 3 high-level procedural languages such as Pascal and C, 4 query and report tools, 5 artificial-intelligence and constraint-based languages (a textbook convention, so books word the later ones differently)
- A higher number is a different style of language, not simply a better one. Older generations are still used where they fit the job
- To place a language, ask what the programmer writes: binary (1), mnemonics (2), step-by-step statements (3), a request saying what is wanted from the data (4), or facts, rules or constraints for the system to solve (5)
Section 1What 'generation' means
Programming languages are grouped into five generations, numbered from one to five. The numbers run from languages closest to the hardware up to languages closest to the way people think and talk. The generation describes the style of a language, not a version number. 'Fifth generation' does not mean 'version 5 of one language'. The five-generation scheme is a textbook convention, so books do not all word the later generations the same way. You should be able to characterise each generation in a few sentences and place an example in the right one. Easy to mix up: a later generation is a different way of working. It does not make every earlier generation out of date.
Section 2First generation: machine language
The first generation is machine language: instructions written directly as binary patterns that the processor carries out with no translation. Each type of processor has its own machine language, so a program written for one type does not run on another. The programmer must work with 0s and 1s. It is very hard to read, write and correct, which is why the later generations were developed.
Section 3Second generation: assembly language
The second generation is assembly language. The binary patterns are replaced by short readable mnemonics such as ADD, and a program called an assembler translates them into machine language. Each assembly instruction becomes one machine instruction, so the programmer still works step by step at the level of the processor. Assembly language is still tied to one type of processor. It is easier to read than machine language, but it is still low-level and slow to write.
Section 4Third generation: high-level procedural languages
The third generation is made of the high-level languages, such as Pascal, C and BASIC. They use English-like statements and algebra-style formulae, and one statement is translated into several machine instructions. Most are compiled into an executable program. They are called procedural because the programmer writes the steps, in order, saying how the job is done: store values in variables, make decisions with IF, repeat with loops. The languages are not tied to one type of processor, so a program can be moved to a different computer that has a suitable compiler. Pascal, the language used in this course, belongs here.
Section 5Fourth generation: query and report tools
The fourth generation is made of tools that let a user ask for results instead of writing the steps. You state what you want, and the tool works out how to get it. Tools often described as fourth generation include query languages, such as SQL, report generators and form designers. They are often built for one purpose, such as asking questions of a database or printing a report. For example, a clerk could request 'list all customers in Mandeville, sorted by surname' without writing any loops. People with little programming training can use these tools, and applications can be built much faster than in a third-generation language.
Section 6Fifth generation: artificial intelligence and constraints
The fifth generation is usually linked to artificial intelligence. The programmer describes the problem, using facts and rules or a list of constraints, and the system works out a solution itself. The programmer does not write the steps. For example, you could state facts about who is whose parent and a rule for what a grandparent is. The system can then answer 'who are Kemar's grandparents?'. Or you could list constraints for a school timetable, such as no teacher in two rooms at once, and let the system find a timetable that satisfies them. Prolog is often given as an example. These languages suit expert systems and other AI work, and they are declarative: they describe the problem, not the steps. Watch out: textbooks word the fourth and fifth generations differently. The key idea to hold on to is what the programmer has to state.
Section 7Placing a language: the quick test
Ask what the programmer writes. 1st: binary patterns. 2nd: mnemonics, translated by an assembler. 3rd: step-by-step statements in a high-level language, usually compiled. 4th: a request for what is wanted, in a query or report tool. 5th: facts, rules or constraints, and the system finds the solution. First and second are low-level and tied to one processor. Third, fourth and fifth are high-level. Here's the trick: the further you go up, the less you say about how the computer should do the job.
Examples
A trainee at a Kingston software company is given five descriptions. A: instructions written as 0s and 1s for one type of processor. B: short codes such as ADD and STORE, translated by an assembler. C: a Pascal program with a loop and an IF statement, translated by a compiler. D: a clerk types a request for 'all orders from Montego Bay in March, sorted by customer name' into a database tool. E: a programmer enters facts and rules about family relationships and asks the system who the grandparents of Kemar are. (a) State the generation of each description. (b) State which generations are low-level. (c) Explain how D differs from C in what the user has to write.
(a) A is first generation (machine language). B is second generation (assembly language). C is third generation (a high-level procedural language). D is fourth generation (a query tool). E is fifth generation (facts and rules, with the system finding the answer). (b) The first and second generations are low-level, because both are close to the hardware and tied to one type of processor. (c) In C the programmer writes the steps in order: how to read the data, loop through it, test each item and print the result. In D the clerk only says what is wanted and the tool works out how to get it.
A distribution firm in Portmore has three jobs. Job 1: the manager wants to produce a different monthly sales report each month by asking the database for the figures she needs, without hiring a programmer. Job 2: trained programmers must build a stock-control program with its own calculations, decisions and loops, and keep it going for years. Job 3: a programmer must write a very small routine that controls one part of a label-printing device directly, using very little memory. (a) Choose a generation for each job. (b) Justify each choice in one sentence. (c) Explain why the tool in Job 1 would not suit Job 3.
(a) Job 1: fourth generation. Job 2: third generation. Job 3: second generation (assembly language). (b) Job 1: a fourth-generation query and report tool lets a non-programmer ask for what she wants without writing the steps. Job 2: a third-generation language such as Pascal or C suits a long program with calculations, decisions and loops, and it is easier to read and maintain than low-level code. Job 3: assembly language gives direct control of the device and can make a small program. (c) A fourth-generation tool is built for one purpose, such as querying data and making reports, and it hides how the work is done. Job 3 needs close control of the hardware, which the tool does not offer.
Now let's water it
Session runs notes to flashcards to quiz back-to-back.
Where this comes from
- CSEC Information Technology Syllabus (CXC 30/G/SYLL 08, revised 2000, 2008, 2013) · Caribbean Examinations Council (CXC) · Section 3, Specific Objective 2 · Syllabus scope
- Information Systems for Business and Beyond (2019 edition), D. T. Bourgeois with J. Mortati, S. Wang and J. Smith, chapters 1, 2, 3, 6, 8 and 10 · David T. Bourgeois (Biola University), eCampusOntario open library repository · Chapter 10, Generations of Programming Languages, page 126, checked against (https://openlibrary-repo.ecampusontario.ca/jspui/bitstream/123456789/656/2/Information-Systems-for-Business-and-Beyond-2019-1591280863.pdf) · Facts
- Navy Electricity and Electronics Training Series (NEETS), Module 22, Introduction to Digital Computers (NAVEDTRA 14194, September 1998) · US Navy (Naval Education and Training Professional Development and Technology Center) · Module 22, Appendix I Glossary (Assembler, Machine language, High-level languages), checked against (https://vtda.org/bits/other/US_Navy/NEETS/US%20Navy%20NEETS%20-%20Module%2022-Introduction%20to%20Digital%20Computers%20NAVEDTRA%2014194.pdf) · Facts
- Navy Electricity and Electronics Training Series (NEETS), Module 22, Introduction to Digital Computers (NAVEDTRA 14194, September 1998) · US Navy (Naval Education and Training Professional Development and Technology Center) · Module 22, Chapter 3 Programming languages (machine language, symbolic languages with mnemonic codes, procedure-oriented languages such as COBOL, FORTRAN and BASIC; a 1998 Navy training text), checked against (https://vtda.org/bits/other/US_Navy/NEETS/US%20Navy%20NEETS%20-%20Module%2022-Introduction%20to%20Digital%20Computers%20NAVEDTRA%2014194.pdf) · Facts