Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hoare quote during Turing award in 1981:

"The first principle was security: The principle that every syntactically incorrect program should be rejected by the compiler and that every syntactically correct program should give a result or an error message that was predictable and comprehensible in terms of the source language program itself. Thus no core dumps should ever be necessary. It was logically impossible for any source language program to cause the computer to run wild, either at compile time or at run time. A consequence of this principle is that every occurrence of every subscript of every subscripted variable was on every occasion checked at run time against both the upper and the lower declared bounds of the array. Many years later we asked our customers whether they wished us to provide an option to switch off these checks in the interests of efficiency on production runs. Unanimously, they urged us not to - they already knew how frequently subscript errors occur on production runs where failure to detect them could be disastrous. I note with fear and horror that even in 1980, language designers and users have not learned this lesson. In any respectable branch of engineering, failure to observe such elementary precautions would have long been against the law."

-- C.A.R. Hoare, Communications of the ACM, 1981



C.A.R. Hoare was the author of the Quicksort algorithm in 1959.


C.A.R. Hoare is both still alive and the author of much more than just Quicksort.


Were you alluding to how it allows worst-case behavior to throw your system way off in unpredictable ways to enable higher performance on average case? And thus contradicting his claim?

Well, he did design that before making that claim in the 80's. Apparently, he learned his lesson. :)


Making it illegal to write code without bounds checking is an interesting and fun concept to imagine.


Why? That's how the vast majority of modern languages work. You can't opt out of bounds checking in Java or Python.


Yes, but they now opt out of other things. Such as nullable variable references.


I was thinking of it more playfully – what would this legislation look like, how would it affect productivity of engineers, it's a curiosity, I don't actually have any stake in it happening.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: