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

Re: dynamic vs. static typing



I think there also exists a psychological component to the chasm between 
proponents and critics of types.

A statically typed language always requires you to declare upfront what 
you intend to do. You cannot just start sketching some ideas around 
without having to affirm your commitment to those ideas at every step of 
the way. Every time you change your mind, you are promptly reminded that 
you just broke some past promise. This irritates some people to the 
extreme. ItÆs as if all they want to do is to just explore their 
incipient ôrelationshipö with their new program, with no strings 
attached. Instead, they quickly find that they canÆt get anything from 
it, unless they are willing to provide written assurances every time 
they want to try something new, no matter how ôinnocentö. Some people 
are simply afraid of commitment :-)

For them the core issue may be that they simply want to feel in full 
control of their programs, without having to make any promises. They are 
afraid that if they take the vows that come with using an STL, at some 
point in the future they will come to regret it: ôWhat if later I want 
to add a widget to this list of gadgets? What then? Why canÆt you just 
trust me that I will do the right thing?ö

Also, the all-or-nothing quality of the commitment required by types can 
be scary. Even in the army, you can refuse to follow certain orders; 
there is some overriding mechanism you can invoke, when the preconceived 
rules simply donÆt apply, and you are ready to accept full 
responsibility. But with types, you are never allowed to step outside 
the bounds, no matter how obvious it is for you that you know what 
youÆre doing.

My own experience with languages like ML, Haskell, or Mercury was that 
each time I tried, I hit a wall very early into my ôrelationshipö with 
the program. However, I have a strong suspicion that this was caused by 
my own current inability to mold my internal intuitions into more 
ômatureö forms of expression, rather than by the limitations of their 
respective type systems. In other words, my goal is to slowly work my 
way toward the fourth of ShriramÆs categories (I have quite some way to go.)

--Florin