This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Confusion over 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.
Stu demonstrates one of the basic problems with an all-dynamic language: "I just spent an hour figuring out why some carefully-tested code went no-op after adding RSpec to a project." As much as I berate Stu at times (both in person and in blog), the fact is, I deeply respect and admire his programming skill, and if he can lose an hour to something that (I submit for your consideration) could have been caught by a static analysis tool fairly easily, then clearly that was a wasted hour of Stu's life. Worse, the problem is not yet solved, since now he has to make a hard choice about which definition to use, or else find a way to hack around the two definitions and create a third. Or perhaps something even uglier than this....
This is a familiar class of problem to most Smalltalkers - the "dualing override/definition" problem. Static typing isn't really going to help you much here; the issue is with having two libraries that want to "own" the same space. It's like having two plugins attempt to add the same menu item - the last one in wins. Namespaces are a partial solution to this, allowing library designers to have their cool stufff live on its own. The difficulty arises when you want to go in and mess with low level internals. Both Ruby and Smalltalk allow that; Java and C# "solve" the problem by simply disallowing it. .