Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!ll-xn!cit-vax!susser From: susser@cit-vax.UUCP Newsgroups: net.lang.st80 Subject: Typed Smalltalk Message-ID: <799@cit-vax.Caltech.Edu> Date: Sat, 12-Jul-86 20:04:02 EDT Article-I.D.: cit-vax.799 Posted: Sat Jul 12 20:04:02 1986 Date-Received: Sat, 12-Jul-86 23:20:22 EDT Organization: California Institute of Technology Lines: 40 I have recently noticed few messages related to adding type mechanisms to Smalltalk. I fail to see the appeal in adding types to Smalltalk. Is there any advantage to a strongly typed Smalltalk? I have always felt, deep in my heart, that strongly typed languages were invented by compiler writers to make their job easier and my job harder. When I first encountered Smalltalk two years ago, I was overjoyed to find a useful untyped language. In the past two years, I have realized that Smaltalk is indeed typed, but in a more subtle, useful way than compiler writers would have us believe a language should be typed. In my mind, computers are supposed to do the grungy work and let me do the creative work. Declaring types is grungy work that does nothing for me and should be handled by the computer in some way. Smalltalk does just that. If I use the wrong class of object, I quickly find out about it when a 'message not understood' window pops up on my display. It is then ridiculously easy to find what I have done wrong and correct it. I find dealing with types in pascal much less satisfying. I have also found that one of Smalltalk's stongest points is its polymorphic nature. Smalltalk's numeric system and collection classes are two of the best examples of the power and flexibility that an untyped polymorphic language can give you. When I write a numeric algorithm in Smalltalk, it is useful for all kinds of numbers - SmallInteger, LargeInteger, Float, Fraction, Complex, Matrix, or any other kind of number I care to write - and I just don't care what type of number somebody may pass to my method. In those few cases when I do care, I can easily determine an object's species or class and make an intelligent decision based on that information. If there is something that type checking can bring to Smalltalk, I just don't see it. If there is someone out there who does see an advantage to types in Smalltalk, I'd like to hear about it. (Sounds like a good topic for a net discussion to me.) -- Josh Susser susser@csvax.caltech.edu susser.pasa@xerox.com Rectangle allInstancesDo: [ :rect | Display reverse: rect].