December 15, 2004
Static vs. Dynamic

Ian Bicking: Because Unanswered Problems Are Always Hard. This really is the single best article pointing out the advantages of dynamic typing that I've ever seen. Quotations:

"Back to reliability: one way to decrease bugs is testing, but another way is to decrease the amount of code. Code deleted is code debugged. Static typing can decrease the number of bugs, but decreasing the amount of code is a much, much more effective way to decrease bugs. If you can have both -- short code and static typing -- then more power to you. I just haven't seen it myself."

"Now forgotten, at one time there were languages that were both weakly typed and dynamically typed; things like assembly and Forth. Ouch. There were two paths from there: one to make runtime values intrinsically typed (Lisp), and one to make the source code intrinsically typed (C). But just because assembly sucked a lot doesn't mean all languages afterward must approach the problem in terms of its suckage. And just because there was that split, doesn't mean joining both worlds (a language with both intrinsically typed values and source, i.e. Java) is better."

"Static type defenders complain about the combinatorial type interactions in dynamically typed languages -- how can you test all the code paths, given all the possible types? But their languages lead to combinatorial code, which is far worse: for many classes of hard problems, they can't solve them once, they have to solve them everytime they are encountered. Ouch."

This has gone around the Python blogsphere like wildfire, naturally. I'm posting here for the Java types who visit from time to time.

Of course, words are cheap, even words as eloquent as Ian's. I know that dynamic languages are just as reliable and much more productive that statically typed languages are through real experience. If you've only tried one approach, give the other a go. You'll learn.

If you don't know what Ian's banging on about, read How Python's Datatypes Compare to Other Programming Languages. If that doesn't make sense, you're either not a programmer, or shouldn't be. ;-)

Posted to Python by Simon Brunning at December 15, 2004 02:22 PM
Post a comment

Email Address:



Remember info?