There are four generations of programming language, the first generation is called machine code (binary - 1s and 0s), the second generation is called assembly code, the third is programming language like Visual Basic and python and the fourth generation is languages like SQL and Haskell. The second to forth generations of programming language have different relations to object (machine) code. The second generation is a one to one relation, meaning that one line of assembly code is equal to one line of 1s and 0s. The third and fourth generations, however, have a relation of one to many, meaning that for one line of Visual Basic or CSS, there could be lots of lines of 1s and 0s.
First generation programming
The first generation of programming language was machine code and could look something like this - 000100010010111101111000110110. Programmers would have to design their code using their hands then transfer it to computers using punch cards or by flicking a switch. The computer does not have to translate the code into 1s and 0s, which means that the program will run straight away. Some other benefits of first generation programming are:
Writing in machine code could lead to many mistakes in the program, so second generation programming languages were created by David J. Wheeler as a way of describing Assembly code. By using codes that resembled English, programming became much easier. The usage of word based codes such as LDA for load and STA for store, meant that code became easier to read and to right. To convert an assembly code program into object code to run on a computer requires an Assembler. The job of the Assembler is to replace each line of assembly code into the equivalent one line of machine code (1s and 0s).
Assembly code and machine code share the same benefits. This means that it is quick to run and is used when writing low level code. Until the release of the first smartphones, assembly code was used to program things like mobile phones. But nowadays languages like C, which is very close to assembly language, are being used more in mobile phone coding.
Third generation (High level languages)
Third generation code is even easier to read than assembly code and makes coding large programs relatively quick and easy. Third generation programming languages gave many new things to code, for example, loops, conditionals and classes. The relation of machine code to third generation language is one to many, meaning one line of third generation code is equal to many lines of 1s and 0s.
Third generation programming language uses imperative languages - code is executed line by line, in a programmer defined sequence.
Third generation codes are high level languages that are imperative. Imperative means that the code is ran line by line, in a set order. Also, third generation languages can be written for one system but work on another. This is called being platform independent. To convert a code written in third generation language into machine code, a complier or an interpreter is needed.
Fourth generation (High level languages)
The purpose of fourth generation language is to reduce the effort it takes to program something and the time to takes to developed software, this leads to an overall decrease in the cost of software development. Sometimes, however, it doesn’t work and can mean that the code is messy and hard to edit/maintain. Many fourth generation languages have been created to do a specific task. Examples of these languages are: SQL a language to query databases, Oracle reports a language that makes reports, CFML a web development language. A type of fourth generation programming is declarative language.
Declarative languages – describe what computation should be performed and not how to perform it.
CSS is an example of a declarative language. It is used in web design.