Live data from Hacker News

A Parable by Dijkstra (1973)

cs.utexas.edu

71–80 of 107 posts

Re: A Parable by Dijkstra (1973)

#71
This seems like it has potential for being the core of an interesting interview question. Maybe something along the lines of "You are hired as the Chief Shunter (lol) of a new rail company and the CEO, to cut costs, has stated that only half of all cars will have toilets. What instructions will you give the shunters? What complications could arise? What is the optimal solution and how would it impact UX?" etc. etc.

Re: A Parable by Dijkstra (1973)

#72
post #26

When the shunting person persuaded everyone to imagine the two-car units as if they were symmetrical, the passengers still complained. Toilets can break, and when they did the doubly unlucky passenger would be forced to walk four car lengths to get to the nearest toilet. Also, those helpful arrows would be guiding the passenger the wrong direction for two of those car lengths. So we have comments that go out of sync…

> the least lucky passenger would have to walk six car lengths I just want to elaborate on this to show which assumptions you are making. There are two ways to make a paired unit: --+ and -+-. In your scenario I think you assume the first. The end of the train is thus ...+----+, since you mention the second last car's orientation being reversed. The +'s represent toilets. Then, what you are saying is to consider a pa…

Yes, though I think the last three feet refers to the vestibule connecting the two carriages, which a passenger in the non-toilet carriage must traverse.

Re: A Parable by Dijkstra (1973)

#73
post #26

When the shunting person persuaded everyone to imagine the two-car units as if they were symmetrical, the passengers still complained. Toilets can break, and when they did the doubly unlucky passenger would be forced to walk four car lengths to get to the nearest toilet. Also, those helpful arrows would be guiding the passenger the wrong direction for two of those car lengths. So we have comments that go out of sync…

> the least lucky passenger would have to walk six car lengths I just want to elaborate on this to show which assumptions you are making. There are two ways to make a paired unit: --+ and -+-. In your scenario I think you assume the first. The end of the train is thus ...+----+, since you mention the second last car's orientation being reversed. The +'s represent toilets. Then, what you are saying is to consider a pa…

Indeed. Dijkstra specifies two cars joined with the toilet in the middle:

"When each car with a toilet was coupled, from now until eternity, at its toileted end with a car without a toilet, from then onwards the shunting yard, instead of dealing with N directed cars of two types, could deal with N/2 identical units that, to all intents and purposes, could be regarded as symmetrical."

Re: A Parable by Dijkstra (1973)

#74

Moral: The engineer who conceived of the innovation was forgotten and not compensated for it, and the train owners made the bulk of the money. Sounds like software engineering to me!

I feel like the actual moral of the story should be "don't underestimate how trying to scrimp on a vital resource can result in horrible logistical complexities and a nightmare UX".

...which can be solved by a simple innovation, given the right approach.

Re: A Parable by Dijkstra (1973)

#75
post #3

For those who want to see Dijkstra's mathematics of programs in action: 1) basic (great for kids, math novices, whatever): https://www.amazon.com/gp/product/0470684534/ref=dbs_a_def_r... (ignore the two star review, this book would get 5 stars from me) 2) advanced (free, complete with videos): http://www.cs.toronto.edu/~hehner/aPToP/ 3) advanced: https://www.amazon.com/gp/product/0470848820/ref=dbs_a_def_r... 4) adva…

Also advanced, but quite readable: https://www.amazon.com/Discipline-Programming-Edsger-W-Dijks...

Re: A Parable by Dijkstra (1973)

#76
post #3

For those who want to see Dijkstra's mathematics of programs in action: 1) basic (great for kids, math novices, whatever): https://www.amazon.com/gp/product/0470684534/ref=dbs_a_def_r... (ignore the two star review, this book would get 5 stars from me) 2) advanced (free, complete with videos): http://www.cs.toronto.edu/~hehner/aPToP/ 3) advanced: https://www.amazon.com/gp/product/0470848820/ref=dbs_a_def_r... 4) adva…

Also, slightly less advanced:

A Discipline of Programming

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

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

Re: A Parable by Dijkstra (1973)

#77
post #9

So in the end the permanently coupled tuple of cars is handled as a single car, it kind of proves that every car must have a toilet? Or perhaps the next manager reiterates the rationale and decides to put just one toilet every two car tuples...

But twice as long and articulated.

Re: A Parable by Dijkstra (1973)

#78
post #56
post #53

> With growing size or sophistication of the program, the operational argument quickly becomes impossible to carry through, and the general adherence to operational reasoning has to be considered one of the main causes of the persistence of the software crisis. What "software crisis"? Since its inception in the 50s or so, software has only gone from strength to strength.

https://en.wikipedia.org/wiki/Software_crisis

Projects running over-budget

Projects running over-time

Software was very inefficient

Software was of low quality

Software often did not meet requirements

Projects were unmanageable and code difficult to maintain

Software was never delivered

Yeah, that one.

Re: A Parable by Dijkstra (1973)

#79
post #64

The final paragraph is my favorite. I have a PhD in mathematics but I've since realized I'm not a mathematician, I'm more of a logician/philosopher. I find the parable very interesting, but I can totally believe a lot of real mathematicians don't. Too many mathematicians, if you crack open a random page of their work, you'll see lots of opaque integrals and calculations. None of that ever appealed to me. Even when I…

[deleted]
Post reply on HN