Re: in praise of type checking
On 10/7/2011 3:43 PM, Roedy Green wrote:
On Thu, 6 Oct 2011 06:43:04 -0700 (PDT), Lew<lewbloch@gmail.com>
wrote, quoted or indirectly quoted someone who said :
It must not have been that widely used, then, if all the uses were in the o=
ne project.
It was widely used within the project. It is internal code I use for
generating references to bookstores/books/electronics at various
online stores.
Even if it were widely distributed, and even if it were a public
method, type checking at least warns my clients I have changed the
signature of a public method without warning them. They may want to
shoot me, but at least they know precisely WHY they want to shoot me.
Even in my private code that I never intend to distribute to
anyone at all, I make a point of changing something's name if I change
its nature. That's seldom onerous, because a change in nature usually
means the old name is no longer appropriate:
/* old */ boolean isImportant() ...
/* new */ float[] isImportant() ... // say, what?
--
Eric Sosman
esosman@ieee-dot-org.invalid