3 ms·
> I'm starting to think that almost all real-world code is trivial. We're working in very different worlds, then. Sure, maybe in CRUD webapps almost all code i
by pron 11y ago
> I'm starting to think that almost all real-world code is trivial.
We're working in very different worlds, then. Sure, maybe in CRUD webapps almost all code is trivial, but if it's trivial then bugs aren't that tricky anyway. But the code that runs distributed database clusters, or avionics software, is far from trivial, and we know (from years of software verification) that verifying that code is essentially hard.
> My experience is that most production bugs are stupidly obvious things. And that possibly all bugs are either stupid "why doesn't the compiler catch that" cases, or code that is bad (unreadable) on its face.
In that case you would see much bigger productivity differences between languages like Haskell and languages like Python, while most (admittedly scarce) data shows that the differences are tiny.
> but verification of JDK sorting uncovered a real bug.
That is a very complicated sorting algorithm, and uncovering it wasn't done automatically, but required hard work. It is precisely an example of small code that is complex, and while formal verification is possible (because it's small), it is not trivial and not automatic. In any event, that code had more to do with my Goldbach example and much less to do with list append. Proving it was nowhere near as trivial as proving append.
- lmm 11y ago> In that case you would see much bigger productivity differences between languages like Haskell and languages like Python, while most (admittedly scarce) data shows that the differences are tiny. My cynical hypothesis would be that Haskell really does lower the defect rate by an order of magnitude or more in comparison to Python (in terms of e.g. correct handling of edge cases), but this doesn't noticeably impact productivity/business value for many use cases.