A Discipline of Programming

Category: Computer Science
Author: Edsger Wybe Dijkstra
This Month Hacker News 2


by todd8   2022-01-21
I have been intrigued by the idea of visual coding tools for many years, but these kind of tools have always disappointed me. They remind me of the system used to teach small children to program in the programming language Scratch, see [Scratch].

I prefer to "visualize" my code as manipulating a set of logical assertions that characterize the state of the computation, ultimately reaching the point where the state of the computation's properties satisfy the requirements. Somewhat like that explained in [Gries1987] and [Dijkstra1976]. Visual tools are just too coarse to capture the details necessary to ensure correctness or real-life requirements.

While UML diagrams sometimes help to make sense of a complex set of OO Class relationships, this is far from how I normally work with the meaning of code in my head while programming.

[Scratch] https://www.amazon.com/Science-Programming-Monographs-Comput...

[Dijkstra1976] https://www.amazon.com/Discipline-Programming-Edsger-W-Dijks...

by User23   2020-06-14
The predicate calculus. I regularly review Predicate Calculus and Program Semantics[1] to increase my fluency in the techniques. I also recommend A Discipline of Programming[2] as a gentler introduction to the subject for those who do not consider themselves particularly mathematically inclined. For me it was a natural progression from doing TDD. I still code test first, but now the structure of those tests and programs is guided by a better understanding of program semantics, greatly increasing my code quality.

[1] https://www.amazon.com/Predicate-Calculus-Semantics-Monograp...

[2] https://www.amazon.com/Discipline-Programming-Edsger-W-Dijks...

by mcguire   2018-07-19
Also, slightly less advanced:

A Discipline of Programming


For more practical fun, consider Frama-C, SPARK, and Dafny.

by User23   2018-07-19
Also advanced, but quite readable: https://www.amazon.com/Discipline-Programming-Edsger-W-Dijks...