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: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public From: Bill Gooch Subject: Re: OO, C++, and something much better! Date: 1997/01/20 Message-ID: <32E395B6.78E9@iconcomp.com>#1/1 X-Deja-AN: 211042469 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> x-rtcode: 6bf9152932ad49b215e393f8 content-type: text/plain; charset=us-ascii organization: Icon Computing mime-version: 1.0 reply-to: bill@iconcomp.com newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object x-mailer: Mozilla 3.0 (WinNT; I) Date: 1997-01-20T00:00:00+00:00 List-Id: Alan Lovejoy wrote: > .... > Damon Feldman wrote: > > .... > > Also, can't you just send everything flying around the system as an Object > > (root of the whole class tree) in those situations when you want dynamic > > typing? > > Not in Java. Java won't let you send any message that the compiler doesn't > know will be valid. And there is no equivalant of #perform: (which sends > a message chosen at run time). Actually there is, as of JDK 1.1 (out now in beta). And you can downcast from Object to get at methods defined on subclasses, even without using invoke. But you still don't get the flexibility of Smalltalk, and ubiquitous downcasting is pretty inelegant (to put it mildly), and defeats the purpose of having static typing in the first place. It seems clear that one could, using Java's reflection API, build a framework for free-form method invocation which would work pretty much like Smalltalk, but with a screwy syntax. It would most likely be extremely slow and garbage intensive (more so than Smalltalk), and code using it would be fairly opaque as well. As always, the difference between the languages is a collection of tradeoffs. I've found that development in Java takes a lot longer getting started, but the code is a bit less bug-prone due to static typing, so debugging it goes a bit faster, except the development environments aren't as good as the ones for Smalltalk yet. But then static typing becomes more helpful, because the compiler catches more of the bugs up front. At the language level, Java has some quirks that Smalltalk effectively avoids (such as some of the wierdnesses of constructors, and compile-time resolution of static references). Overall, I prefer Smalltalk for development, but I think Java will be a better application delivery vehicle once the language and its IDEs mature. Although I didn't agree when I first read it, I now believe Jeff Sutherland's Smalltalk manifesto was right on the mark. Smalltalk paved the way in a lot of areas, and now Java is poised to drive down those roads at high speed. -- William D. Gooch bill@iconcomp.com Icon Computing http://www.iconcomp.com Texas liaison for the International Programmers Guild For IPG info, see http://www.ipgnet.com/ipghome.htm