There has been a vigourous debate in the couple of years running through the whole software development community on the merits of Dynamic vs Static typing.
Where do I stand?
Static Typing Forever!!!
I still love statically typed languages. For me, its the only way to fly.
The safety & correctness aspect of static typing is only a part of their value.The fundamental reason for typing is to put more of the intent of the code into the language. Thus requiring less knowledge be stored in the programmers head.
def writeToStream(stream) stream.write(@content) end bytesWritten = envelope.writeToStream(filestream)
In this Ruby example, the programmer clearly intended “stream” to be a particular type of object. That is, stream does have a type, its just implicit in their head. Well then, why not use a language and toolset smart enough to understand type of ‘stream’? Why burden the programmers brain with sole responsibility for implementing the type system?
Yes, I’ve used Dynamic Typing in Anger
The challenge: Making Static Typing easier
I think the surging popularity of dynamic typing is symptomatic of the pain of the syntax-heavy static type systems in C++/Java/C#. But I would rather fix the pain and keep the types.
Type Inference is the answer. To those who favor dynamic types: have you looked at statically inferred-type language like Scala, Boo or Haskell?