3 ms·
I am reminded of this classic snark from The Elements of Programming Style (1974)[0]: "Some compilers allow a check during execution that subscripts do not exc
by tacon 8y ago
I am reminded of this classic snark from The Elements of Programming Style (1974)[0]:
"Some compilers allow a check during execution that subscripts do not exceed array dimensions. This is a help … many programmers do not use such compilers because “They’re not efficient.” (Presumably this means that it is vital to get the wrong answers quickly.)" (Page 85)
[0] https://en.wikipedia.org/wiki/The_Elements_of_Programming_Style https://en.wikipedia.org/wiki/The_Elements_of_Programming_St...
- AstralStorm 8y agoUsually the real reason is that such checks are pointless as they do not pinpoint the bugs. They are too late. You need a real stack trace to begin debugging such issues. Languages like Ada Spark or Rust tend to rarely use or need such runtime checks. (they are available as an option to check unsafe code) Others like Python and Java do check and give you traces. Not for free though. And then you probably want something more powerful, such as a virtual machine like Valgrind; full sanitization of Address Sanitizer, etc.