Re: Graceful Failure
Posted: Aug 30, 2005 5:50 PM
> > In the case of optional typing, the example I cited, is
> > the most prevalent issue in my mind. It has bad enough
> > an outcome, namely a difficult to track bug in the
> > software, that it's important to me to disallow that
> > choice.
> As we've seen, being able to disambiguate variable
> definition from variable use is a valid concern, but as we
> have other means to remedy the problem it cannot be /the/
> reason for explicit type declaration.
But what magic am I missing by having explicit type declarations. I.e. what's not happening that would add value to my software if I didn't provide typing?
We have the whole duck typing thing. In my RCL language that I did at AT&T on the 5ESS switch, 10+ years ago, I provided duck typing. But that was because I didn't have interfaces. When Java came out about 1 year after I finished v1.0 of my language, I was sold on interfaces. I later added optional typing so that you could declare method arguments to be typed explicitly. It was still a runtime check though. But that was a decision based on not complicating my compiler. It had to be maintainable by people without compiler design degrees/experience.
What I learned about duck typing was it made it easy to throw software together that you didn't have a good design based for yet, while you were prototyping. But, eventually, it comes back to haunt you because you can't point a programmer at the softwares requirements except on a completely separate piece of documentation which will likely not be kept up to date. With explicit typing, we have written requirements that are readable, in the context that they apply. I find that useful.