Thoughts on strong typing

Posted by scientific on February 20, 2007


Proposition: Strong typing is necessary when buffers overflow directly into ram. If you have no possibility of writing directly to ram, then duck typing will always be enough.

What do you think? Reasonable assertion? When i started learning Ruby, I was very skeptical of duck typing. But I keep using it and the world doesn’t end. As the proponents point out, if something is going to fail on the static type definition, it’s also going to fail two lines further down, and probably with a more informative error message. Either way, your code doesn’t work, so strongly typed languages don’t help make code better or more maintainable. They do help prevent you from suffering buffer overflows, which one could argue is why static typing was invented?

I’m still not totally convinced this is true for very large or complex systems, but with the advent of soap interfaces and wsdl, it seems like even in these systems, the lowest common denominator (interface) is basically what you cram through a telnet port as xml..

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

Comments