Newsgroups: comp.object,comp.lang.eiffel,comp.lang.c++,comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!travelers.mail.cornell.edu!news.kei.com!news.mathworks.com!newsfeed.internetmci.com!howland.reston.ans.net!nntp.crl.com!pacbell.com!gw2.att.com!nntpa!not-for-mail
From: arw@mtatm.mt.att.com (Aaron Waters)
Subject: Re: Why is one OO language more productive than another?
Message-ID: <DEuJFu.M6w@nntpa.cb.att.com>
Sender: news@nntpa.cb.att.com (Netnews Administration)
Nntp-Posting-Host: mtatm.mt.att.com
Organization: AT&T
References: <808962188.12601@rugrat.demon.co.uk> <42joi1$aft@snlsu1> <DEL955.7H4@nntpa.cb.att.com> <4341rt$1bv@snlsu1>
Date: Wed, 13 Sep 1995 13:43:06 GMT
Lines: 42
Xref: glinda.oz.cs.cmu.edu comp.object:38275 comp.lang.eiffel:10834 comp.lang.c++:148720 comp.lang.smalltalk:28292


Patrick Frend <frend@ferndown.ate.slb.com> writes:
>arw@mtatm.mt.att.com (Aaron Waters) wrote:
>>You can't [establish type correctness in Smalltalk, et al.]. 
>>Just like in a strongly typed language you can't prove that
>>a correctly typed object has a valid value.  I agree that the static
>>typing is overrated, especially since it's so darn coarse (eg, just
>>because x is an int, doesn't mean it's prime, as it should be) and
>>since dynamic typing (eg, completely heterogeneous hash tables, or
>>lists of callbacks that generate an arbitrary something with a ".draw"
>>method) can be so darn useful.
>
>If x is an 'int' type and something expects a 'prime' type then you'd get a
>compile time error. (one less bug you don't have to test for at runtime!).

Nonsense.  If I set p = prime(i) I still get a runtime error if i isn't
a prime.  Gimmeabreak. And for the record, primality testing is expensive.
And for the record, proving that i will always be prime is a fantasy.

>...Both the examples you give are easy enough in statically/strongly typed
>languages. In c++ you'd just inherite from a common base class (drawable). 
>i.e. a class with no members but a virtual member function called draw().
>If you then try to draw a object which isn't drawable, you'd get a compiletime
>error....

Yeah, but if you bought the underlying classes from two different software
vendors, you've got some nasty hacking to do... unless you can get them to
agree to subclass from the same base class (and good luck).  Not a
problem in dynamic languages.  Honest to goodness folks, having completely
heterogeneous hash tables and lists, with type-testable elements can
be real nice.

In sum, dynamic and static typing each have advantages and
disadvantages and I don't think either is inappropriate for
"professional, long term" applications, necessarily... Now let's all
sit down in a circle holding hands and sing "Come by h'yah, m'lord"...
a one and a two and -- everybody now! -- ....

		-Aaron Watters

knock. knock. who's there? duane. duane who?
DUANE THE BATHTUB I'M DUOWNING!
