The Artima Developer Community
Sponsored Link

Agile Buzz Forum
You have to pay somewhere

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
You have to pay somewhere Posted: Oct 26, 2007 4:35 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: You have to pay somewhere
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

I ran across an argument against the "all objects, all the time" theory that Smalltalk uses - Reg Braithwaite tries to make an argument against complexity, using Magnitudes to illustrate - say you want to add a new Magnitude subclass to the system. He argues:

Well, there is a huge problem with this arrangement: Addition is commutative. 1.0 + 2 must give the same result as 2 + 1.0. Using a simple message to implement addition means that you must be excruciatingly careful to handle all of the possible cases so that you do not accidentally violate this property. Now of course, the designers of system classes like Integer and Float went to this trouble. But if you want to add another magnitude class—say CurrencytwoPlaceDecimal—you have to open up all of the system classes and modify them so that 1 + ThirtyCents gives the same result as ThirtyCents + 1.

You're going to have to pay for that complexity somewhere. You can pay for it the Smalltalk way, by adding new methods to each Magnitude subclass, or you can pay for it his way. The funny thing is, his solution for Java-like languages is to build a double dispatching Visitor (I find this amusing because the Smalltalk solution for Magnitudes is double dispatch). Hmm - this results in harder to understand code (and lots of it). I think his quest for purity in what an object understands has led him down the path to harder to read code.

I'm not sure I'd call that a win.

Read: You have to pay somewhere

Topic: Smalltalk Daily 10/24/07: Launching a Web Browser Previous Topic   Next Topic Topic: Smalltalk at OOPSLA

Sponsored Links



Google
  Web Artima.com   

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