The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Incoherence after the point

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Incoherence after the point Posted: Apr 24, 2005 12:45 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Incoherence after the point
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.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

One of my readers sent me a link to this artcle on "duck typing" (i.e., what Smalltalkers have called dynamic typing for eons now). Here's the part I found incoherent:

First of all, let's get a frequently asked question out of the way: if two interfaces have the same methods, are they semantically equivalent? Isn't there a risk to pass an object that is totally wrong for this method, yet will work because it responds to the right methods?
I don't have a clear answer to that, but my experience is that such a thing is very unlikely. This kind of argument is a bit similar to the fear we all felt in the beginning of Java when we realized that containers are not typed: ClassCastExceptions end up being much more rare than we all thought.
Duck Typing is a big time saver when you write code, but is it worth it? Don't you pay this ease of development much later in the development cycle? Isn't there a risk that you might be shipping code that is broken?
The answer is obviously yes.

So the sorts of errors the author fears are virtually non-existant, but they introduce a huge risk of shipping broken code. Excuse me? Is it just me, or is the author arguing with himself here?

One of the things I really like about this mode of argument is that testing isn't sufficient - we need something stronger (enter declarative typing). If that's the case, why do people writing in C++, Java, or C# even need to test? Doesn't the typing obviate the need for it? The point is, you need to test anyway. If a given paradigm - dynamic typing in this case - increases productivity - and if declarative typing doesn't obviate the need for testing (it doesn't) - then what does the typing buy you? Better arithmetic performance, mostly. That's useful for a small range of applications (and, for most of those, we can use a high level language like Smalltalk and mixin lower level languages for the performance critical sections. Plenty of our customers do just that.

The author comes up with a contrived example to show that declarative typing will save you from a potential runtime nightmare. I say contrived because I've written code using the kind of API he talks about many, many times. Want to know how many times I've walked into the minefield he fears? It's a small number, except for the larger values of zero.

The best part of the whole thing is the comments, where some of the responders claim that refactoring tools are "impossible" in languages like Smalltalk. Times like this I wonder how many people realize that all the cool stuff that people think came from Java - like refactoring support and unit testing - were invented in Smalltalk more than a decade ago.

I swear, this entire industry actively engages in amnesia...

Read: Incoherence after the point

Topic: Funny online audio Previous Topic   Next Topic Topic: This is not a good sign

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use