The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Smalltalk Simplicity and Consistency

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
Smalltalk Simplicity and Consistency Posted: Apr 18, 2006 5:05 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Smalltalk Simplicity and Consistency
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 the nicer things about Smalltalk is the consistency of the object model. A fair amount of that is due to the fact that everything is an object, and that dynamic typing allows for developers to just "do what works". I have a pretty simple example of this - let's look at the method #factorial

result := 10 factorial.
result inspect.

That gives us:

Small Integer Inspector

Ok, that doesn't seem exciting - we ended up with a SmallInteger object. However, now let's try this one:

result := 100 factorial.
result inspect

Large Integer Inspector

The nice thing here is that we didn't have to do anything special - in the process of getting the answer to the second question, the SmallInteger object got promoted up to a LargePositiveInteger, and I didn't need to do anything - no setting up of interfaces, no casting, no need to ensure that all factorials produce LargePositiveInteger objects - they get created when they are needed. Developers can do that themselves, btw - the library does this kind of thing with numbers, you can do similar things with your own objects as needed.

The bottom line - Smalltalk stays out of your way, and lets you solve the problem at hand. Instead of having the satisfy the anal retentive needs of the compiler.

Read: Smalltalk Simplicity and Consistency

Topic: Taxes and the joys of Windows Previous Topic   Next Topic Topic: Enterprisey-Ness Unbound

Sponsored Links



Google
  Web Artima.com   

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