Article View: comp.lang.misc
Article #3341Re: blip [Re: Dynamic typing -- To Have and Have Not ...]
From: Darren New
Date: Tue, 02 Apr 1991 21:32
Date: Tue, 02 Apr 1991 21:32
32 lines
2175 bytes
2175 bytes
In article <879@puck.mrcu> paj@uk.co.gec-mrc (Paul Johnson) writes:
>On the other hand I am interested in the assertion that type errors
>are rare in Smalltalk development. Does anyone have any statistics to
>back this up?
Well, I have one statis. :-) My dissertation project is implemented in
Smalltalk. I've been working on it for four years or so, and I've gotten
three types of type-mismatch errors (i.e., "message not understood"):
1) Looked up a name in the wrong dictionary, didn't check the result
because I "knew" it would always be there, sent the result (nil,
because it wasn't found) a message, and "nil" didn't understand it.
Not a type error because the problem was the wrong dictionary, not the
wrong type. Some other runtime error (subscript out of bounds, say)
would have happened in another language.
2) Sent a message to a string instead of to the result of looking up
that string in a dictionary. Always caught on the first test run.
3) Sent a message to an object which should have implemented that
message but didn't because I didn't think it would be called on this
particular test run. Always caught the first time.
In summary, "wrong type" errors just never really came up because they
were the wrong type except number 2. In that case, it was always
invariably caught on the first run of that method.
-- Darren
--
--- Darren New --- Grad Student --- CIS --- Univ. of Delaware ---
----- Network Protocols, Graphics, Programming Languages, FDTs -----
+=+=+ My time is very valuable, but unfortunately only to me +=+=+
+ When you drive screws with a hammer, screwdrivers are unrecognisable +
Technical Details
Message-ID:
<49589@nigel.ee.udel.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!ee.udel.eduReferences:
<14160@life.ai.mit.edu> <1991Mar25.201620.5839@cua.cary.ibm.com> <879@puck.mrcu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!ee.udel.edu From: new@ee.udel.edu (Darren New) Newsgroups: comp.lang.misc Subject: Re: blip [Re: Dynamic typing -- To Have and Have Not ...] Message-ID: <49589@nigel.ee.udel.edu> Date: 2 Apr 91 21:32:35 GMT References: <14160@life.ai.mit.edu> <1991Mar25.201620.5839@cua.cary.ibm.com> <879@puck.mrcu> Sender: usenet@ee.udel.edu Organization: University of Delaware Lines: 32 Nntp-Posting-Host: snow-white.ee.udel.edu