The Artima Developer Community
Sponsored Link

Agile Buzz Forum
OO vs. Same old Stuff

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
OO vs. Same old Stuff Posted: Nov 27, 2005 2:31 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: OO vs. Same old Stuff
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

Berin Loritsch notes a difference between the way Java developers approach things, and the way Smalltalk developers approach things:

As I was writing about certain principles that influence simplicity, I came across the disparity between the typical Java way and the original Smaltalk way of designing your objects. Take for instance the problem of moving an object left 25 pixels and down 30. A Smalltalker would do something like this:


rect.moveLeft: 25 Down: 30

And in Java:


Point p = rect.getLocation();
rect.setLocation( p.X() - 25, p.Y() + 30 );

Anyone see the problem right away? In OOP 101, the principle is that you tell an object what you want it to do. Notice that isn't query an objects state and then modify it. In the Smalltalker's code, he is clearly telling the rectangle to move left 25 and down 30 and the parameters are verbose enough to make that clear. With Java we ask the object where it currently is, and assuming that bigger numbers mean right and down we give it a new location.

The point? Java developers are still working at the data structure level - there are objects, but they aren't really being treated like objects.

Read: OO vs. Same old Stuff

Topic: GMail Lag Previous Topic   Next Topic Topic: Ryan Lowe gets it

Sponsored Links



Google
  Web Artima.com   

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