Skip to main content
wvxvw's user avatar
wvxvw's user avatar
wvxvw's user avatar
wvxvw
  • Member for 11 years, 2 months
  • Last seen more than 4 years ago
awarded
awarded
awarded
awarded
awarded
Loading…
awarded
comment
Why is writing down mathematical proofs more fault-proof than writing computer code?
@YuvalFilmus just like in the quote: ten pages of assertions is long for humans. How do I judge about the length of a program? Well, Dikstra offered a metric: the length of its text. I think that it may be too simplistic, but it is a good heuristic nevertheless. There are other, more interesting metrics, like, for example, cyclomatic complexity
Loading…
comment
Why is writing down mathematical proofs more fault-proof than writing computer code?
Upvote for quoting Dijkstra, but you chose the wrong place! He has written a lot about this problem in the first paragraphs of Structured Programming. I wouldn't want to alter your answer by submitting a different quote, but I would hope you'd look into adding more from that paper to your answer!
Loading…
Loading…
awarded
answered
Loading…
revised
Traverse Matrix in Reverse Diagonal strips
Just to see how the matrix is organized.
Loading…
Loading…
awarded
comment
Example of an algorithm that lacks a proof of correctness
@chi you don't understand... it's not that programmers don't care for correctness of their code, it's that for some algorithms the concept of "correctness" is not applicable. Take some .NET WindowsForms application, which says something to the effect: "put this button with this label at this position, then put this other button at this other position and so on..." - there might be some interpretation of what this program does, under which what it does may be judged as (in)correct (eg. graphic designer says it "looks ugly"), but that's as far as it goes.
comment
Example of an algorithm that lacks a proof of correctness
Algorithms don't have to be correct... suppose you have this: (1) put an empty bucket on the windowsill in the morning. (2) take it down in the evening. (3) measure the volume of water in the bucket. (4) repeat next morning. This is a description of an algorithm, but it doesn't describe anything that can be, without a stretch, called "correct". Interestingly, most programming code in the world is written in this particular way: it just isn't concerned with correctness of what it does at all.
1
2 3 4 5
13