I tried to respond to “Russ Olsen’s” blog but was unable to do it since jroller decisded to label me as a spammer… That should teach me about going to a JRoller site again!
Anyway he wrote about how gread dynamic languages are and I just had to respond to his post http://jroller.com/page/rolsen?entry=who_s_afraid_of_dynamic
Here is my response as is without a change:

Where do I begin… First we agree on one thing, as engineers we should talk about facts and everything has its place even dynamic types.
However, I have to say that I HATE dynamic typing. Yes I know I’m an engineer I should use facts rather than emotions but having spent ages debuging dynamic languages when I was younger this is something I’m very passionate about:

1. You mentioned the word “token” to indicate redundancy. This is missleading in a big way, in a compiled language like Java this additional token will cost almost nothing and in an interpreted language the additional cost of another token to parse will be offset by some of the optimizations the interpreter can make thanks to this additional hint to the interpreter.

2. In your example you give the example of the “isEmpty” method which really indicates that you could have a “MesurableLength” interface that objects should implement.

3. Strong typing is the basis of Java’s dynamic security actually one of the first well known security bugs in Java was caused by illegal casts that weren’t checked by the verifier.

4. The strong typing in Java enables some of the exceptional JIT runtime optimizations available in Java.

5. Strong typing prevents bugs. Unit testing is never EVER capable of reaching 100% code coverage on a well designed complete real world application.

I’ll take your example and raise you one. Say you have an object that represents a stack of Strings and you pass it by mistake to the “isEmpty” method instead of the first string within that stack. The stack allows you to invoke methods on the string such as to determine its size() but the length method is used to determine the length of the stack… So you will get an answer of false when the result can be true.
In your example you gave a case of a missing method which is easy to find, but the truly problematic case is the one where objects get mixed up and that happens quite a bit! Especially when following good programming practices and naming everything consistently!

This “new” scripting language craze is a standard trend that gets rehashed every 7 or so years (and I have the old DDJ magazines to prove it), it is a craze that only happens in the mind of hackers… Few software companies or corporations ever buy into this since it is pointless for anything other than “glue” code the duct tape. I think duct tape has a very important role in keeping corporations and the internet itself going, but to build a truly large mission critical system on top of a scripting language would be corporate suacide.

Advertisements