The thread called “Getting Dynamic Productivity in a Static Language” on Artima has generated a lot of very interesting comments.
In particular, the following statement made me react:
So that was the history, and so I was asking him what it was that made him feel so productive in Smalltalk, and one of the things he said is he didn’t have to waste time thinking about types.
This is a fundamental mistake that a lot of dynamic enthusiasts (short for “dynamically typed language enthusiasts”) keep making over and over.
The fact is: you always have to think about types when you write code, period.
Dynamic enthusiasts are convinced that they can ignore this aspect of development altogether, but it always comes back to bite you, either when
- you write tests for your code
- you try to refactor it
- somebody else needs to modify it
- or simply when someone needs to use your code
Eventually, you look at an object and you have to figure out what methods or messages it responds to, and I find that this problem is much easier to solve when the answer is in the source code in a form that can be enforced by the compiler.
If you are interested in this topic, read the entire thread, it’s worth it.