That … doesn't seem like a problem that exists in the world as it exists (but see the caveat below on my qualification to make such statements). It seems like the real world of programming is so full of people who are so used to conflicting, underspecified, and post hoc requirements that it doesn't occur to them that there is any other way, and so we live in a world in which it is simply assumed that software doesn't actually work as it is supposed to do, even if only in edge cases. Should all software be formally specified? No, and I'm sure that, despite his passion for overstatement, even Dijkstra didn't think so—but I think that the programming world would probably be a better place if more programmers were aware of the potential and possibility of formalisation, and so could introduce and take advantage of it as appropriate.
> But more importantly: this sucks all of the joy out of it! Who here got into programming out of a passion for translating formal functional specifications into formal proofs?
Me! I think it's not fair to assume that everyone enjoys programming for the same reason that you do, any more than it would be for Dijkstra to assume that others do or should for the same reason that he did. To be fair, though, I'm a mathematician, not a professional programmer.
> But more importantly: this sucks all of the joy out of it! Who here got into programming out of a passion for translating formal functional specifications into formal proofs? How can any of the magic of software survive such a mindset?
Sure, but I do like the bliss of watching a tiny piece of code knowing it's sound by induction.
Huge? Not by today's standards. Complex? Again, not by today's standards, but they didn't have today's libraries to build on. Costly? Definitely.
Pretty strictly defined? They tried to be, but the gaps always showed. Certainly they were not strictly defined by Dijkstra's standards.
If you look at one of the books where he and his colleagues teach how to do this (for example, A Method of Programming, by Dijkstra and Fiejen) it's pretty clear that the programmer him(her)self is supposed to come up with the formal specification. Much of the book is about how to write the specifications.
The formal specifications are just assertions - they are Boolean expressions that express properties of the solution. For example the formal specification for a square root function might be abs(r*r - x) < d, where x is the number, r is the root, and d is an error tolerance.
In general these formal specifications cannot be mechanically compiled into an executable program - they are nonconstructive - like the square root example above. So you still have to find or invent an algorithm.
An interesting feature of Dijkstra's method is, he does suggest some heuristics for getting from the assertions to the code, that can help you discover an algorithm. They remove the mystery surrounding how some non-obvious algorithms were discovered.
Dijkstra's approach is actually a lot like test-driven development - the idea is, you start with some assertions that describe what the code is supposed to do, then you check the assertions as you go -- instead of writing a bunch of code and checking it at the end. The difference is just how you check the assertions - by running tests or by attempting a proof. Test cases are formal specifications too - they are just incomplete - somebody said they are 'specification by example'.
Even if Dijkstra's approach is not irrelevant, it is inhuman - it makes the programmer into a machine. (Note that the first "computers" were human machines.)
> 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.
And so we produce programmers who are helpless without formal functional specifications, and are therefore incapable of writing any software in the real world, with conflicting, underspecified, and post-hoc requirements.
But more importantly: this sucks all of the joy out of it! Who here got into programming out of a passion for translating formal functional specifications into formal proofs? How can any of the magic of software survive such a mindset?