Daniel S. Dietiker
2 min readApr 10, 2017

--

I’m not saying that dynamic typing does not have advantages under specific circumstances (scripting, prototyping, etc.). But, in general, I have to object. First of all, the obvious: Static typing gives you the guarantee that a function can only be plugged in where the types match. Of course, types do not describe what exactly a function does. But it is a precise way of communicating certain properties of your function to a potential client. If you read code from another person, and you have types, you know under which assumptions the author of the function operated.

Now, concerning the ranges–well, this *is* the type. This goes back to what I was saying at the very beginning of my first response: We are used to think in abstractions which are artifacts of how real computers happen do be built today–using fixed-sized integers that wrap around, etc. However, as we both agree, abstraction is key; we should think in the problem domain and let the computer figure out an optimal match between our program and the available hardware–ideally.

While I cannot judge for Smalltalk (maybe, static typing makes really no sense given the notion of passing messages between objects, and/or it would be really cumbersome to introduce), my experience with all code I’ve written so far is that, as soon something goes beyond prototyping, there is absolutely no benefit in not having types.

(Nominal) static typing also has disadvantages, of course. In Java, for instance, you might need to create a subclass just to make a class implement an interface that an API expects. However, in my opinion, the potential issues with dynamic typing are much more problematic.

--

--