Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!news.cac.psu.edu!news.pop.psu.edu!hudson.lm.com!godot.cc.duq.edu!news.duke.edu!news-feed-1.peachnet.edu!darwin.sura.net!nih-csl!loglady.ninds.nih.gov!johnk
From: johnk@spasm.niddk.nih.gov (John Kuszewski)
Subject: Re: Strong type checking...
Message-ID: <1995Mar20.163307.21954@alw.nih.gov>
Sender: postman@alw.nih.gov (AMDS Postmaster)
Nntp-Posting-Host: spasm.niddk.nih.gov
Reply-To: johnk@spasm.niddk.nih.gov (John Kuszewski)
Organization: National Insts. of Health
References:  <markjrD55495.GLo@netcom.com>
Date: Mon, 20 Mar 1995 16:33:07 GMT
Lines: 48

In article <markjrD55495.GLo@netcom.com>, markjr@netcom.com (Mark Roulo) writes:
|> 	My company will be beginning a new project shortly and we are
|> still considering both languages and operating systems.  The languages
|> that are effectively in the running are: C++, Smalltalk, and Eiffel.
|> Because this is going to be a large (250,000 - 1,000,000 C equivelent line)
|> project involving about 12 to 20 programmers, strong type checking is
|> kinda important.  So ... can anyone tell me if there is a way to:
|> 	a) Add strong type checking to Smalltalk (this method only
|> 	   takes numbers, for example, and then have all the source code
|> 	   scanned to insure that this is the case).

SmalltalkAgents (and most other Smalltalks) provides a mustBeKindOf: instance
method of Object that can do this for you, ie.

myMethod: myArgument

    "make sure we have valid input"
    myArgument mustBeKindOf: Vegetable.

    "now do something with it"
    mySalad add: myArgument.

Call myMethod: with on an instance of Cow and it generates an exception.


|> 	b) Provide statistics that show that the advantages of *not*
|> 	   needing to do your own garbage collection (free/malloc, new/delete)
|> 	   outweigh the lack of type checking from the standpoint of building
|> 	   robust applications.

I'm sure the guys from Easel will parade out some numbers for you.
I've certainly been on the wrong end of a memory leak on several occasions,
and it's painful to track one down.


-- 
                                   _____________
                                   |        ___/_
                                   |        |/  /
                                   --  /\  //  /--
                                   ||  ||  /  /||
                                   ||  || /  / ||
                                   ||  ||/  /  ||
John Kuszewski                     ||  |/  /|  ||      
johnk@spasm.niddk.nih.gov          ||  /  /||  ||
                                   \/ /  / ||  \/
that's MISTER protein G to you!     |/__/|      |
                                      /_________|
