3 ms·
Your comments on Dijkstra are blasphemous ;-) I often see a lot of folks here on HN who are too eager to pass judgement on Dijkstra without having read and und
by rramadass 6mo ago
Your comments on Dijkstra are blasphemous ;-)
I often see a lot of folks here on HN who are too eager to pass judgement on Dijkstra without having read and understood his writings nor giving much thought to the context and times which shaped his thinking. All of his opinions should be thought over and appropriately adapted for use in our context. He was a wide-ranging polymath philosopher (technical and non-technical) with a laser-like focus on exactitude using Mathematics. Radical approaches must be pushed, particularly when they are hard/difficult to learn and understand. If his language was biting, then it was so much the better for promulgating his cause viz. "correctness over easy", "mathematical reasoning underpinning everything", "structure in aid of the previous", "proper language syntax/design in aid of the previous" etc.
As an example; read EWD 1036: On the cruelty of really teaching computing science (https://www.cs.utexas.edu/~EWD/transcriptions/EWD10xx/EWD1036.html https://www.cs.utexas.edu/~EWD/transcriptions/EWD10xx/EWD103...) in entirety and carefully. The thesis is that computing is "radically novel" from other forms of human endeavour and hence it cannot be taught by simplifying to known analogues and adhoc procedural operations. You need the rigor and exactitude of Mathematical Logic to build a "Scientific" basis.
Excerpts:
... What is a program? ... I prefer to describe it the other way round: the program is an abstract symbol manipulator, which can be turned into a concrete one by supplying a computer to it. After all, it is no longer the purpose of programs to instruct our machines; these days, it is the purpose of machines to execute our programs.
So, we have to design abstract symbol manipulators. We all know what they look like: they look like programs or —to use somewhat more general terminology— usually rather elaborate formulae from some formal system. It really helps to view a program as a formula. Firstly, it puts the programmer's task in the proper perspective: he has to derive that formula. Secondly, it explains why the world of mathematics all but ignored the programming challenge: programs were so much longer formulae than it was used to that it did not even recognize them as such. Now back to the programmer's job: he has to derive that formula, he has to derive that program. We know of only one reliable way of doing that, viz. by means of symbol manipulation. And now the circle is closed: we construct our mechanical symbol manipulators by means of human symbol manipulation.
...The point to get across is that if we have to demonstrate something about all the elements of a large set, it is hopelessly inefficient to deal with all the elements of the set individually: the efficient argument does not refer to individual elements at all and is carried out in terms of the set's definition.
...
Back to programming. The statement that a given program meets a certain specification amounts to a statement about all computations that could take place under control of that given program. And since this set of computations is defined by the given program, our recent moral says: deal with all computations possible under control of a given program by ignoring them and working with the program. We must learn to work with program texts while (temporarily) ignoring that they admit the interpretation of executable code.
Another way of saying the same thing is the following one. A programming language, with its formal syntax and with the proof rules that define its semantics, is a formal system for which program execution provides only a model. It is well-known that formal systems should be dealt with in their own right, and not in terms of a specific model. And, again, the corollary is that we should reason about programs without even mentioning their possible "behaviours".
... a program is no more than half a conjecture. The other half of the conjecture is the functional specification the program is supposed to satisfy. The programmer's task is to present such complete conjectures as proven theorems.
He then goes on to describe the importance of teaching Predicate Calculus via a simple imperative language where its semantics are given by proof rules. This language is described in EWD 472: Guarded commands, non-determinacy and formal derivation of programs - https://www.cs.utexas.edu/~EWD/transcriptions/EWD04xx/EWD472.html https://www.cs.utexas.edu/~EWD/transcriptions/EWD04xx/EWD472... There is no compiler for this language and so the student is forced to implement the program and its proof by hand. However this radical approach is not being accepted by educationists/industry.
He concludes;
Teaching to unsuspecting youngsters the effective use of formal methods is one of the joys of life because it is so extremely rewarding. Within a few months, they find their way in a new world with a justified degree of confidence that is radically novel for them; within a few months, their concept of intellectual culture has acquired a radically novel dimension. To my taste and style, that is what education is about. Universities should not be afraid of teaching radical novelties; on the contrary, it is their calling to welcome the opportunity to do so. Their willingness to do so is our main safeguard against dictatorships, be they of the proletariat, of the scientific establishment, or of the corporate elite.
- anthk 6mo agoSICP already does that for the programmer, and "Concrete Abstractions" for the novice making it ready for SICP.
- rramadass 6mo agoNot quite. The books you mention deal with "Software Abstractions" i.e. Procedural Abstraction, Data Abstraction, ADT, Patterns etc. They are at a much higher level than Dijkstra's concepts. What Dijkstra is talking about is the Set Theory/Logic Operations underlying all of them. This is why he was sceptical of OO/Functional etc. styles of programming. They were all mere syntactic sugar over the underlying Mathematics obscuring the essence of Programming. For him all computation is basically a series of manipulating values from a Set as a whole using Logical Expressions i.e. Predicate Calculus. Again from EWD1036; Before we part, I would like to invite you to consider the following way of doing justice to computing's radical novelty in an introductory programming course. On the one hand, we teach what looks like the predicate calculus, but we do it very differently from the philosophers. In order to train the novice programmer in the manipulation of uninterpreted formulae, we teach it more as boolean algebra, familiarizing the student with all algebraic properties of the logical connectives. To further sever the links to intuition, we rename the values {true, false} of the boolean domain as {black, white}. On the other hand, we teach a simple, clean, imperative programming language, with a skip and a multiple assignment as basic statements, with a block structure for local variables, the semicolon as operator for statement composition, a nice alternative construct, a nice repetition and, if so desired, a procedure call. To this we add a minimum of data types, say booleans, integers, characters and strings. The essential thing is that, for whatever we introduce, the corresponding semantics is defined by the proof rules that go with it. Right from the beginning, and all through the course, we stress that the programmer's task is not just to write down a program, but that his main task is to give a formal proof that the program he proposes meets the equally formal functional specification. While designing proofs and programs hand in hand, the student gets ample opportunity to perfect his manipulative agility with the predicate calculus. Finally, in order to drive home the message that this introductory programming course is primarily a course in formal mathematics, we see to it that the programming language in question has not been implemented on campus so that students are protected from the temptation to test their programs. And this concludes the sketch of my proposal for an introductory programming course for freshmen. The language mentioned above is described in EWD472 (also see wikipedia for a detailed explanation - https://en.wikipedia.org/wiki/Guarded_Command_Language https://en.wikipedia.org/wiki/Guarded_Command_Language). Notice the total absence of syntactic sugar and fancy computation models i.e. no complex Types, no mapping to lambda calculus or any other mathematical model (since a computer is fundamentally imperative over a state space) etc. It is just the absolute basic mathematics of Set Theory and Logic. Note that Tony Hoare had systematized the algebra for this in his "Hoare Logic" via Pre/Post conditions for a executable statement - https://en.wikipedia.org/wiki/Hoare_logic https://en.wikipedia.org/wiki/Hoare_logic Dijsktra then went one-step further by giving automatic calculational rules to derive a program by simple logical manipulation of symbols. In this case we reason backwards from the output of the program (known apriori from its functional specification) i.e. from postcondition to precondition using the idea of a predicate transformer. This is his weakest-precondition (wp) calculus where with each executable program statement a Pre = wp(Statement, Post) total function is defined by the Programmer i.e. his code must satisfy the function which is the predicate transformer transforming the postcondition to a weakest-preconditon. See this wikipedia page on Predicate Transformer Semantics for a nice detailed explanation - https://en.wikipedia.org/wiki/Predicate_transformer_semantics https://en.wikipedia.org/wiki/Predicate_transformer_semantic...