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: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,724ec2348205c52c,start X-Google-Attributes: gid109fba,public From: David Shang Subject: Re: OO, C++, and something much better! Date: 1997/06/27 Message-ID: <33B43B2F.5D9F@corp.mot.com>#1/1 X-Deja-AN: 252990411 Sender: news@schbbs.mot.com (SCHBBS News Account) References: <32ED02EE.22E2@netright.com> <32ED2448.685A@parcplace.com> <32EE20A3.755D@netright.com> <5cm364$dc2@topdog.cs.umbc.edu> <5cr068$gpa@uni.library.ucla.edu> Organization: MOTOROLA Reply-To: shang@corp.mot.com Newsgroups: comp.object,comp.lang.c++,comp.lang.ada,comp.lang.smalltalk,comp.lang.eiffel Date: 1997-06-27T00:00:00+00:00 List-Id: Jay Martin wrote: > > Heh. Look at Microsofts API's, requires casts everywhere. The COM > model, their ultimate "object-oriented model", requires a cast just > call a method on a object. Since, Wintel is on like 90%(?) of > installed machines, thats practically everyone. C/C++ programmers > "cast" more than programmers of other languages. Please be specific on what sitiuations that C++ requires more casts than other languages such as Java and Eiffel? The fact that a system that happens to use C++ has a lot of casts does not mean that C++ requires more casts. The system may use the same amount of casts if it is implemented in other languages in the same way. There are two cases that we need casts: 1. The type of the object from the outside of an open world is unknown and must be verified. 2. The type of a declared variable within the world is not precise enough to exclude bad cases. We cannot avoid the first case. But the second case should be avioded as much as possible. Unfortunately, C++ as well as other languages does not deal with the second case perfectly, especially in the csae where types are dependent. Transframe does better on this issue. It requires fewer casts than any other languages. David Shang