Static & Strong Typing

I can’t take it. I really can’t. I see moronic post after moronic post, all over the internet, bashing static/strong typing. I can’t comment on them all, so I’m going to ball up my response here:

You’re all wrong.

Let me qualify this by first saying: getting things done is #1 in terms of importance. So when all else is equal, use static typing. And when investing in technology, we should err this direction as well, because static/strong typing is hands down the best way to program.

Let me answer some retorts: 

“But Aaron, static typing gets in my way, and slows me down!”

Do you drive a car without looking at your fuel level, and ignoring your side mirrors as well? It only gets in your way for two reasons: 1) you don’t understand your type system, which means the model you defined, meaning you aren’t a good programmer, or 2) you’d rather ignore real problems than man-up and address them.  

“But Aaron, you can do more with dynamic languages!”

Fundamentally wrong… all those neat dynamic language tricks can be easily modeled in any strongly-typed, static language. And guess what… where that isn’t possible, the only things a dynamic language can do that static one can’t? It has more ways to fail. Seriously guys, this has been show over and over (and proven!) Let’s drop this one.

“But Aaron, a good programmer can make any language work!”

Sure, like a master carpenter can build an entire house by himself, using just a hammer. Static typing is a tool, and once you’ve learned the tool, it’s hard to go back to more primitive ways. Most ‘master programmers’ who poo-poo static typing don’t know the tool, and are insecure in their ability. I have a message for them:

Actually invest time in learning static typing, functional programming etc. You will be a far better programmer for it, even if you don’t use the tools in your work. You’ll at least think in terms of them.

 Thanks,

  Aaron 

 UPDATE:  It’s true you don’t need a proof that something works, for it to work anyway. That’s not the most important thing to me: it’s the process of having the compiler help you get there. Is it dumb to co-program because you think your co-workers are worthless? Of course not, so don’t hate on the machine that can sit there and help you all day long.