From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public From: Eric Clayberg Subject: Re: OO, C++, and something much better! Date: 1997/01/22 Message-ID: <32E67751.4AFC@parcplace.com>#1/1 X-Deja-AN: 211547447 references: <32DF458F.4D5C@concentric.net> <32DF94DC.6FF8@watson.ibm.com> <32DFD972.37E4@concentric.net> <5bphq4$5js@mulga.cs.mu.OZ.AU> <32E05FAF.47BA@concentric.net> <5buodl$bci@boursy.news.erols.com> <32E2FEC7.2F7B@concentric.net> <5bvncj$gqg$1@A-abe.resnet.ucsb.edu> <32E47B4B.56D9@concentric.net> <5c4fr0$27j@mulga.cs.mu.OZ.AU> content-type: text/plain; charset=us-ascii organization: ParcPlace-Digitalk, Inc. mime-version: 1.0 reply-to: clayberg@parcplace.com newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object x-mailer: Mozilla 3.0 (Win95; U) Date: 1997-01-22T00:00:00+00:00 List-Id: Fergus Henderson wrote: > Alan Lovejoy writes: > >When typing errors only constitute 2% or less of all errors, it's time > >to check the cost of eliminating the final 2% of the problem. > My experience is that errors caught by type checking constitute a LOT > more than 2% of errors. > For a period of time I carefully recorded the cause of every error that > I found while writing a Mercury program. Of the 155 errors that I > recorded, 73 were error caught by the type checker. If anything, I think that reflects poorly on the syntax of whatever language you were using. The more "rules" a language has, the more involved its syntax, and the more draconian its type system, then the more type errors are likely to be created by the developer and then caught by the compiler. In a language like Smalltalk which has an absurdly simple, consistent syntax, and which has a very open-mined concept of "type", very few type errors are ever created to begin with and thus very few actually exist to be found. The *few* real type errors that are created tend to be caught almost immediately by Smalltalk's superb debugging facilities. Having been involved with commercial Smalltalk development for quite a few years, I tend to agree with Alan that the percentage of actual type related errors in Smalltalk programs is less that 2% - far less in my experience. I have written over several hundred thousand lines of commercial Smalltalk code and have been involved in several dozen large Smalltalk projects (ranging from 100,000 lines of code and up). In all that time, I have only run across a handful of true type errors (of the nature that a static type checker would catch). The Smalltalk language is very simple and very flexible and makes a lot of things perfectly legal that would not be allowed in, say, C++. Most "message not understood" errors, in fact, are to the nil object in Smalltalk (the moral equivalent of a null pointer in C). These are not really type errors, but usually problems with improper initializations or premature discarding of data. These are logic problems; not type problems. A static type checker would catch them no better in Smalltalk than it would in C++. I am amazed at the level of hubris evidence in this discussion. Folks are jumping in and making assumptions about how Smalltalk works based upon how their favorite statically typed language works. Smalltalk has very different rules than what are common in most statically typed languages. Smalltalk simply doesn't need static type checking. If you have any doubts about that, then you should try it out yourself. You can download Smalltalk Express (a fully function, 16-bit Windows Smalltalk IDE) for free from http://www.objectshare.com. -Eric