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: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public From: mbk@inls1.ucsd.edu (Matt Kennel) Subject: Re: OO, C++, and something much better! Date: 1997/01/23 Message-ID: <5c8dkh$2e0@news1.ucsd.edu>#1/1 X-Deja-AN: 211784876 references: <32E67751.4AFC@parcplace.com> followup-to: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object organization: The University of California at San Diego reply-to: %%spam repellent: remove this prefix%%mbk@inls.ucsd.edu newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object Date: 1997-01-23T00:00:00+00:00 List-Id: Eric Clayberg (clayberg@parcplace.com) wrote: : 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. Yes this indeed is the point. With such a language most errors turn into some form of "illegal data", a.k.a. "why is this in here?" The language is more homogeneous and the errors are likewise so. That such a thing is completely good is not at all _prima facie_ true. : 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++. This is where I disagree---a really good static language can express interesting logical structure in the type system, and mechanically prevent a number of "logic" errors as in other systems because they had checkable type consequences. Now, I don't personally think C++ is a "really good static langauge", suffering from a number of faults and deficiencies against Smalltalk. A static type langauge need not be manifestly typed everywhere (programmer putting specific written type annotations on all variables); a small dose of type inference substantially increases the "prototypability" and elides lots of stupid 'search-n-replace' busywork found in dumber static languages. : 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. That ST is clean and coherent without it is not under debate. : -Eric cheers Matt