4 ms·
About the last part of the post, Ada has asserts if my memory is correct. And Oberon, if it's still alive. And Eiffel with assertions on preconditions and postc
by pmontra 2y ago
About the last part of the post, Ada has asserts if my memory is correct. And Oberon, if it's still alive. And Eiffel with assertions on preconditions and postconditions of routines (functions or procedures.) Probably those features were shared by many other languages that were fashionable some 30 years ago and never became mainstream. Then Java and C++ did to the industry what C did in the 70s/80s and all those features retreated from what developers almost used to what researchers wrote in their papers.
- pjmlp 2y agoJava has had such kind of tooling as addon, thing is most folks don't care. https://objectcomputing.com/resources/publications/sett/september-2011-design-by-contract-in-java-with-google https://objectcomputing.com/resources/publications/sett/sept... C++ contracts might finally land in C++26, after missing two revisions, although in a minimal form.
- mrkeen 2y agoIt's because runtime checking is trivial. We can all code up something to crash-if-condition, or except-if-condition, or log-if-condition.
- Joker_vD 2y agoWe can, yes, but we also can forget to code any such condition as well, which is all too common. And for e.g. C the lack of an explicitly supplied by the programmer runtime-check is exactly equivalent to the programmer explicitly stating and pledging that such runtime-check is entirely unnecessary, and even it's trivial to statically check at compile time that this pledge is in fact false, no diagnostics is required.
- imtringued 2y agoThey didn't provide a model checker to accompany the contracts the library provides. No integration with Java Pathfinder or JBMC? It's really weird how much they missed the ball. https://en.wikipedia.org/wiki/Java_Pathfinder https://en.wikipedia.org/wiki/Java_Pathfinder https://www.cprover.org/jbmc/ https://www.cprover.org/jbmc/
- touisteur 2y agoAda has asserts, but also pre/postconditions and contracts, invariants, type predicates, not null pointers. Most can be checked statically through SPARK ... with some effort. GNAT also has validity checks, which are very, very useful. Fuzzing finds so many bugs with those... https://blog.adacore.com/running-american-fuzzy-lop-on-your-ada-code https://blog.adacore.com/running-american-fuzzy-lop-on-your-...