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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public From: kennel@lyapunov.ucsd.edu (Matt Kennel) Subject: Re: OO, C++, and something much better! Date: 1997/01/28 Message-ID: <5cm3ns$2qa@news1.ucsd.edu>#1/1 X-Deja-AN: 212859710 references: <5bphq4$5js@mulga.cs.mu.OZ.AU> <32E05FAF.47BA@concentric.net> <5buodl$bci@boursy.news.erols.com> <32E2FEC7.2F7B@concentric.net> <6PE5zLpF3RB@herold.franken.de> <32E8DC1C.4871@rase.com> followup-to: comp.lang.eiffel,comp.lang.ada,comp.lang.c++,comp.lang.smalltalk,comp.object organization: The University of California at San Diego newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.c++,comp.lang.smalltalk,comp.object Date: 1997-01-28T00:00:00+00:00 List-Id: Robert C. Martin (rmartin@oma.com) wrote: : In article <32E8DC1C.4871@rase.com>, tansel@rase.com wrote: : "...type checking is against the nature of OO...in OO we conly care about : the type of the other object." : In fact, type checking is at the very *heart* of OO. The current debate : has nothing to do with whether types ought to be checked or not, indeed they : *must* be checked. The current debate is simply arguing about *when* those : types will be checked. : In ST, users send messages to objects. They must be reasonably sure that : the object they are sending the message to can respond to that message. So : they are performing the type checking in their head. The language performs the : same check later on, at run time. : In C++, the compiler insists that all types are declared, so that when : a programmer sends a message to an object, the compiler can be 100% certain : that the object can accept that message. Thus, no run time check is : necessary. I disagree, the issue is larger than this. A statically typed language provides type constraints about the interpretation those human readable things called 'symbols' and their implementation as variables. These type constraints, as implicit assertions, don't exist otherwise. The ``time of checking'' is a technological consequence of these assertions, but one could write Eiffel compilers with smalltalk-style incremental byte-coded highly homogeneous representations which delay typechecking until runtime, and still have more things to check. Assignment, whether implicit (argument substitution) or explicit, is a point requiring a check, not just subroutine calls. *** My discomfort with a fully dynamic typing scheme is that it depends on the particular implementation exigencies of some routine to signal whether something is 'right or not'. For instance, one could pass things which accept the "doit_one" message to routine X, if this particular X happens to call "doit_one" in its implementation. Now, I wish to make a subclass with routine X', which now calls "doit_two" in addition to "doit_one". All of a sudden, I am not guaranteed substitutability, because some objects were passed to routine X which, contrary to my expectation, didn't uphold "doit_two". So subclassing in Smalltalk doesn't necessarily guarantee a true subtype. And if routine "X" were just a temporary 'debugging' stub very little check would be done. I wish to worry less about the particular details of the contents of subroutines, and be able to conceive of abstract categories of classes and behaviors. I would find type-checking most useful in extending an existing program (reminding me of implicit promises), more than initial development when I could remember all the pieces at once. : Robert C. Martin | Design Consulting | Training courses offered: