[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dynamic vs. static typing



[Pascal Costanza <costanza@web.de>]
> 
> 
> I think this is the only _real_ advantage that static type systems 
> provide. They provide two perspectives on the same code that are 
> different in interesting ways. When these two perspectives match, you 
> get a sense that you are up to the "right thing". And this is what 
> static type systems have in common with, say, unit tests, or any other 
> technology that provides interesting new perspectives on your code.
> 
> The central misunderstanding of ST advocates is that the interesting 
> aspects of static type systems are a) that they have anything to do 
> with preventing bugs and b) that they are automatic. Both aspects 
> disregard that programming is essentially a human activity. The 
> interesting aspect of a static type system is that you create two 
> different perspectives on the code you write and that you have a way to 
> check whether these two perspectives match.
> 


There's one other interesting and important aspect: a well-designed
static type system provides a second perspective that is provably
complete in some relevant and well-specified way, as opposed to, for
example, unit tests. With unit tests, the responsibility for ensuring
(and understanding) completeness of coverage lies entirely with the
programmer.

Matt
-- 
Matt Hellige                  matt@immute.net
http://matt.immute.net