This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Type errors in Dynamic Typing
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
This post has raised quite a conversation. As it happens, there's a similar thread over on cls. Peter Lount has also posted a response. I responded to the classic "what about bad message sends" argument like this:
I see this argument all the time. In practice, I rarely see Smalltalkers having issues that look tlike that. The most common reason for MNU (MessageNotUnderstood) in Smalltalk is sending a
message to nil - which happens due to a failure to initialize.
So you can raise this argument all you want, and most Smalltalkers (and I suspect other dynamic language users) will yawn - because it's simply not a problem we see.
Personally, in coding I've done over the last decade in Smalltalk, I've had a problem that static typing would have solved for me... twice. That's right, twice. I recall the number because it's been so uncommon. Static typing does impose costs - in flexibility, in time to market, and in maintenance down the road. To my mind, given the frequency of actual type errors that static typing would have helped me with - that cost is not worth it.
I'll go further than that though - here's one of the more hysterical comments in my post thread:
Dunno what sort of world you're programming in... but lets see... four extra days of programming time versus losing $1,000,000 on that bank transfer... or not notifying the customer of their flight change... or landing that plane 4 metres BELOW ground level hmmmmm... in programming, safer == better. ALWAYS. Because the impact of extra programming time is known and controllable. The impact of an unexpected bug is NOT.
Sure, I can't protect against ALL problems. But I CAN protect against a car driving down the footpath. Any protection is better than no protection at all.
This reminds me of nothing so much as political arguments that rely on "what about the children" for their backing store. It means that you don't actually have an argument, so you've decided to make an emotional case instead. I give such arguments all the time they deserve....