The Cruelty of Really Teaching Computer Science
Encyclopedia
“On the Cruelty of Really Teaching Computing Science” is a 1988 paper by E. W. Dijkstra which argues that computer programming
should be understood as a branch of mathematics
, and that the formal provability
of a program
is a major criterion for correctness.
Despite the title, most of the article is on Dijkstra’s attempt to put computer science
into a wider perspective within science
, teaching being addressed as a corollary
at the end.
Specifically, Dijkstra made a “proposal for an introductory programming course for freshmen” that
consisted of Hoare logic
as an uninterpreted formal system
.
has almost always been considered too resource-intensive to be feasible. In complex applications, the difficulty of correctly specifying what the program should do in the first place is also a common source of error. Other methods of software testing
are generally employed to try to eliminate bugs
and many other factors are considered in the measurement of software quality
.
The notion that cost of production of hardware should be a constraint in programming was foreign to Dijkstra. He viewed the cost controls as artifacts that could become excuses and the controls of nature as nonexistent in digital systems, which above the level of circuits guarantee a second, constructed nature.
Until the end of his life, Dijkstra maintained that the central challenges of computing hadn’t been met to his satisfaction, due to an insufficient emphasis on program correctness (though not obviating other requirements, such as maintainability
and efficiency
).
, programming by contract, and design patterns
. Programming techniques to avoid bugs and conventional software testing methods are taught as basic requirements, and students are exposed to certain mathematical tools, but formal verification methods are not included in the curriculum except perhaps as an advanced topic. So in some ways, Dijkstra's ideas have been adhered to; however, the ideas he felt most strongly about have not been.
There is also greater emphasis on the social aspects of programming, such as learning how to program as part of a team, and how to write code that is easily re-used by other people. Some institutions focus more on pleasing the computing industry by teaching the most popular programming languages, or teaching the use of commonly available development tools, than they do on imparting the foundational concepts of computing science.
Computer programming
Computer programming is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs. This source code is written in one or more programming languages. The purpose of programming is to create a program that performs specific operations or exhibits a...
should be understood as a branch of mathematics
Mathematics
Mathematics is the study of quantity, space, structure, and change. Mathematicians seek out patterns and formulate new conjectures. Mathematicians resolve the truth or falsity of conjectures by mathematical proofs, which are arguments sufficient to convince other mathematicians of their validity...
, and that the formal provability
Mathematical proof
In mathematics, a proof is a convincing demonstration that some mathematical statement is necessarily true. Proofs are obtained from deductive reasoning, rather than from inductive or empirical arguments. That is, a proof must demonstrate that a statement is true in all cases, without a single...
of a program
Computer program
A computer program is a sequence of instructions written to perform a specified task with a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute...
is a major criterion for correctness.
Despite the title, most of the article is on Dijkstra’s attempt to put computer science
Computer science
Computer science or computing science is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems...
into a wider perspective within science
Science
Science is a systematic enterprise that builds and organizes knowledge in the form of testable explanations and predictions about the universe...
, teaching being addressed as a corollary
Corollary
A corollary is a statement that follows readily from a previous statement.In mathematics a corollary typically follows a theorem. The use of the term corollary, rather than proposition or theorem, is intrinsically subjective...
at the end.
Specifically, Dijkstra made a “proposal for an introductory programming course for freshmen” that
consisted of Hoare logic
Hoare logic
Hoare logic is a formal system with a set of logical rules for reasoning rigorously about the correctness of computer programs. It was proposed in 1969 by the British computer scientist and logician C. A. R. Hoare, and subsequently refined by Hoare and other researchers...
as an uninterpreted formal system
Formal system
In formal logic, a formal system consists of a formal language and a set of inference rules, used to derive an expression from one or more other premises that are antecedently supposed or derived . The axioms and rules may be called a deductive apparatus...
.
Debate over feasibility
Since the term "software engineering" was coined, formal verificationFormal verification
In the context of hardware and software systems, formal verification is the act of proving or disproving the correctness of intended algorithms underlying a system with respect to a certain formal specification or property, using formal methods of mathematics .- Usage :Formal verification can be...
has almost always been considered too resource-intensive to be feasible. In complex applications, the difficulty of correctly specifying what the program should do in the first place is also a common source of error. Other methods of software testing
Software testing
Software testing is an investigation conducted to provide stakeholders with information about the quality of the product or service under test. Software testing can also provide an objective, independent view of the software to allow the business to appreciate and understand the risks of software...
are generally employed to try to eliminate bugs
Software bug
A software bug is the common term used to describe an error, flaw, mistake, failure, or fault in a computer program or system that produces an incorrect or unexpected result, or causes it to behave in unintended ways. Most bugs arise from mistakes and errors made by people in either a program's...
and many other factors are considered in the measurement of software quality
Software quality
In the context of software engineering, software quality refers to two related but distinct notions that exist wherever quality is defined in a business context:...
.
The notion that cost of production of hardware should be a constraint in programming was foreign to Dijkstra. He viewed the cost controls as artifacts that could become excuses and the controls of nature as nonexistent in digital systems, which above the level of circuits guarantee a second, constructed nature.
Until the end of his life, Dijkstra maintained that the central challenges of computing hadn’t been met to his satisfaction, due to an insufficient emphasis on program correctness (though not obviating other requirements, such as maintainability
Maintainability
In engineering, maintainability is the ease with which a product can be maintained in order to:* isolate defects or their cause* correct defects or their cause* meet new requirements* make future maintenance easier, or* cope with a changed environment...
and efficiency
Algorithmic efficiency
In computer science, efficiency is used to describe properties of an algorithm relating to how much of various types of resources it consumes. Algorithmic efficiency can be thought of as analogous to engineering productivity for a repeating or continuous process, where the goal is to reduce...
).
Pedagogical legacy
Computer science as taught today does not follow all of Dijkstra's advice. Following Dijkstra's earlier writings, the curricula generally emphasize techniques for managing complexity and preparing for future changes. These include abstractionAbstraction (computer science)
In computer science, abstraction is the process by which data and programs are defined with a representation similar to its pictorial meaning as rooted in the more complex realm of human life and language with their higher need of summarization and categorization , while hiding away the...
, programming by contract, and design patterns
Design pattern (computer science)
In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that...
. Programming techniques to avoid bugs and conventional software testing methods are taught as basic requirements, and students are exposed to certain mathematical tools, but formal verification methods are not included in the curriculum except perhaps as an advanced topic. So in some ways, Dijkstra's ideas have been adhered to; however, the ideas he felt most strongly about have not been.
There is also greater emphasis on the social aspects of programming, such as learning how to program as part of a team, and how to write code that is easily re-used by other people. Some institutions focus more on pleasing the computing industry by teaching the most popular programming languages, or teaching the use of commonly available development tools, than they do on imparting the foundational concepts of computing science.