Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!abvax!iccgcc!klimas From: klimas@iccgcc.decnet.ab.com Newsgroups: comp.object Subject: Re: Type-safe does not mean safe Message-ID: <1365.2712e433@iccgcc.decnet.ab.com> Date: 10 Oct 90 14:04:50 GMT References: <3832@osc.COM> <1990Oct2.170910.4805@eua.ericsson.se> <1990Oct5.010703.16019@Neon.Stanford.EDU> <1990Oct5.184609.7942@odi.com> Lines: 22 In article <1990Oct5.184609.7942@odi.com>, dlw@odi.com (Dan Weinreb) writes: > In nearly every implementation of Pascal, Fortran, C, and C++ that I > know about, if you make an array of 7 elements and store a value into > the 10th element of the array, execution of the program will happily > complete the operation, almost certainly clobbering random unrelated > variables and/or objects, creating a bug that is relatively hard to > find. (I know that there are exceptional implementations, such as > Sabre C; this lack of checking is not a property of the language per > se, but of most implementations of the language.) Hmmm! I have yet to encounter an implementation of FORTRAN that didn't do checking on array bounds during compilation and runtime! > Both static type checking and runtime array/memory checking > are helpful things to have, and the absence of either has certainly > caused me grief at various times. My experience is that neither is > essential but both are desirable. On the whole, I feel that the > importance of static type checking is overemphasized; it's just one > of many kinds of automatic checking that aid in program development > and debugging. Agreed! Actual hard numbers I've been told indicate that only about 10% of the errors can be caught using static type checking in large programs.