What to expect
Early programs were hard-coded with wires and switches, or programmed in binary.
The development of programming languages is the story of this chapter, including Grace Hopper’s “FLOW-MATIC” and “COBOL”, structured programming and the “GOTO heresy”, object-oriented code and a look at functional languages.
A quick preview of the chapter follows, this is my explanation of the different programming paradigms.
In the imperative paradigm, we write commands for the computer to perform, like imperative mood in English, where “come here” gives an instruction.
The focus is on control flow and programs consist of sequence, selection and iteration.
Early programming meant manually entering binary codes. Assembly language gave us mnemonics, but we still needed to understand the architecture. High-level languages FORTRAN, ALGOL and COBOL, abstract away the code from the architecture, letting us use English keywords IF, WHILE and FOR. A compiler translates this code into machine code, but we need one for every computer system, and because each high-level statement generates multiple machine code instructions, the object code might not be optimal.
Sequence, selection, iteration and subprograms are no accident, but a natural feature of algorithms, and are used in all imperative languages descended from ALGOL, including Pascal, C and Python. Structured code is preferred to “spaghetti code” because it’s readable and easy to maintain. C was written by the creator of Unix, and the “hackers’ language” evolved into C++ and C#, but has fussy syntax so is tricky to learn. Universities first taught using FORTRAN then Pascal but in 1981 UK schools went with BASIC as it was already popular on home computers. BASIC inspired Visual Basic, popular in the 1990s and still used today.
Object-oriented programming beginning with Simula and Smalltalk, gave us classes which are blueprints for objects, each object has attributes and methods and can interact with other objects. This programming style is useful for games programming but also modelling, simulation and AI applications. Java was the most popular language from around 2000-2015 because it was object-oriented and portable: it could run anywhere thanks to a Java virtual machine created for every popular platform.
Imperative languages like Java, C and Python execute a sequence of instructions. Another paradigm is declarative programming, which comes in two types: functional languages like LISP, Scala and Haskell, and logic languages like Prolog. A functional language describes merely how data is processed by functions. This often results in more elegant code with fewer bugs and is suited to scientific analysis and AI applications.
An understanding of this topic begins with the knowledge that at its heart a computer is just a collection of logic circuits which process digital signals of high and low voltages, representing zeros and ones. The circuits are able to decode certain patterns of zeros and ones and these bit patterns we call instructions. Each CPU responds to a finite set of these “low level instructions”: its machine code instruction set.
High-level code must be translated into machine code before it can be run on the CPU. For this we need a translator, and these come in two types: compiler and interpreter. Compilers translate the whole high-level source code program into machine code, creating an executable file of object code. Interpreters translate the program one line at a time, which allows for rapid coding and debugging but slower execution than compiled code.
References from this chapter…
 TX-0 instruction set is here http://www.bitsavers.org/pdf/mit/tx-0/MIT_TX-0_InstructionSet.txt
 Dijkstra, CACM, March 1968.
 Knuth, “Structured programming with go to statements” 1979.
 Compilation stages on Isaac Computer Science
 See Isaac Computer Science for a tutorial on OOP.
 Haskell in Industry at the Haskell wiki: http://wiki.haskell.org/Haskell_in_industry
 “Why use Haskell” at the Haskell wiki: https://wiki.haskell.org/Introduction
 Paul Dubois quote from here https://morioh.com/p/11a20d9f2d0b
 App Lab at code.org https://code.org/educate/applab