Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!noao!arizona!gudeman From: gudeman@cs.arizona.edu (David Gudeman) Newsgroups: comp.lang.misc Subject: Re: Run-time Type Errors in Smalltalk Message-ID: <2023@optima.cs.arizona.edu> Date: 17 Apr 91 03:27:28 GMT Sender: news@cs.arizona.edu Lines: 40 In article <1991Apr15.234559.16293@comp.vuw.ac.nz> Brian Boutel writes: ]|> ]|> How do you get a 10% increase in safety from the above? If they ]|> hadn't caught those errors by static typing they would have caught ]|> them by testing -- the same way the found the other 90% of the ]|> errors. ]The claim that testing catches all errors is laughable. Sure is. Did someone make that claim? ]The figures quoted refer only to errors that have been detected, not to ]all errors. And the errors that can be caught by static type checking are almost universally so trivial that they probably all _would_ be caught by testing. The same cannot be said for the errors introduced by complex code that is trying to get around the static type declarations -- to do something that would be easy in a dynamically typed language. ]So what can be said about all the errors in the quoted C++ project that ]were not caught by testing and are still in the production code? ] ]I'll tell you. They are not type errors. Nope, you can't tell that. C++ production code can core dump due to a type error. That's because to implement something that really needs dynamic typing you often have to use tricks that leave all type checking up to the programmer. What can you say about errors that occur in production code in dynamically typed languages? First, they are not caused by the necessity of getting around the static type checker. Second, they are almost never type errors of the sort that could have been caught by a static type checker. Third, if they are type errors they cannot cause a core dump or other unpredictable behavior. -- David Gudeman gudeman@cs.arizona.edu noao!arizona!gudeman