Building Blocks

Building Software Better

A Taste of Flex

Posted by Mark on September 2, 2008

One of my favored books in the 1980s was ‘A Taste of Smalltalk’. This was a very short book that gave you the flavor of Smalltalk programming (the language and IDE) as compared to Pascal, C, and Lisp. I believe it is always important to show multiple programming languages for concepts and this book followed that rule. The goal of this post-series is to take ‘A Taste of Smalltalk’ and apply it to Flex. This is the second of my comparisons in this series, where the first one was in Ruby.

Advertisements

Posted in Flex, Ruby, Smalltalk | Leave a Comment »

A Taste of Ruby (Part 5)

Posted by Mark on August 29, 2008

This is a multi-part series. The first in the series is here.

Tower of Hanoi — With Graphics

To follow the flow of code progress within “A Taste of Smalltalk”, we next need to include a graphical representation of the disks and their movement between the poles. As mentioned previously, converting this part to Ruby has a problem: Ruby doesn’t include graphic capabilities. So we have to pick an extension or add-on to Ruby that will enable us to hook into the graphics system.

Posted in Dynamic, Ruby, RubyShoes, Smalltalk | 1 Comment »

A Taste of Ruby (Part 4)

Posted by Mark on August 29, 2008

This is a multi-part series. The first in the series is here.

Tower of Hanoi — With Model Objects

The book “A Taste of Smalltalk” jumps from showing a single ‘TowerOfHanoi’ object to both adding in Disk model objects and putting on a graphical representation of those Disk objects. Given Ruby has no built-in graphic capability, I want to separate these two changes. So first we can put in Disk objects and study that change. This should work for anyone with a Ruby installation and does not require installing Tk or Shoes or anything. After that, we can go into some GUI toolkit code just to finish up the comparison and have bonus points.

Posted in Dynamic, Ruby, Smalltalk, Virtualization | Leave a Comment »

A Taste of Ruby (Part 3)

Posted by Mark on August 29, 2008

This is a multi-part series. The first in the series is here.

Tower of Hanoi — With A Real Object

The first two examples were not really object-based. They are purely procedural, the algorithm is expressed completely recursively, and execution state is maintained on the call stack. This works fine if we are just ‘tracing’ the algorithm, but it does not let us show the state of the towers at any given time. We also don’t see much in the way of real objects. By adding the state of the towers in, we now have a reason to have stateful objects and new Classes of objects to maintain that state. The added code with some explanation is in Chapter 4, Page 45.

Posted in Dynamic, Ruby, Smalltalk | Leave a Comment »

A Taste of Ruby (Part 2)

Posted by Mark on August 29, 2008

This is a multi-part series. The first in the series is here.

Tower of Hanoi — Procedural With Input

The second example from “A Taste of Smalltalk” is in Chapter 3, page 36 and does basic IO. Except that Smalltalk-80 includes a Windowing graphics system so it can automatically open Dialogs and other things. Smalltalk (started in 1972) was one of the environments that _created_ personal computers and included abilities in its VM and Libraries that are now submerged into the operating system (some 30 years later). Now that these abilities are ‘intrisically’ present, there are many different ways to access them — so Ruby does not include graphics itself (in its own terms) but calls extensions that provide those graphics. Given I don’t really want to go into Tk or Web programming when discussing a language itself, I will simplify the problem and make it so we only need to get the value somehow… So ‘gets’ is fine.

Posted in Dynamic, Ruby, Smalltalk | Leave a Comment »

A Taste of Ruby

Posted by Mark on August 28, 2008

One of my favored books in the 1980s was ‘A Taste of Smalltalk’. This was a very short book that gave you the flavor of Smalltalk programming (the language and IDE) as compared to Pascal, C, and Lisp. I believe it is always important to show multiple programming languages for concepts and this book followed that rule. The goal of this post-series is to take ‘A Taste of Smalltalk’ and apply it to Ruby.

Posted in Dynamic, Ruby, Smalltalk | Leave a Comment »

Being Ephemeral

Posted by Mark on August 28, 2008

There are lots of topics in programming languages, IT infrastructure, and system design that turn out to be all about persistence vs. being ephemeral. I don’t believe people realize it, but “being ephemeral” is the core question and the standard answer should be? 42. Which given it is >0 is ‘Yes’. So “Be Ephemeral” unless you can’t possibly be ephemeral.

Posted in Ephemeral, Ruby, Smalltalk | Leave a Comment »

Why dynamic-typing? (3)

Posted by Mark on August 27, 1997

Java Collection

Joern Janneck wrote:
> Mark Fussell wrote:
> > If you need a specific example, consider the [completely randomly
> > selected] JDK 1.2 Collection code of:
> >     public boolean AbstractCollection::removeAll(Collection c) {
[snip]
> >
> > The static-typing problem in this extremely simple code is that 'c' only
> > needs to respond to 'contains', not be a Collection.  This means I can't
> > just use any containment concept I want to (say, remove all people who
> > are 6' tall)
>
> ... which is something that could be defined as a collection, couldn't
> it? at least in a good design, it should be able to.

I don’t think you really mean that. Of the 13 operations for a Collection:

Posted in Dynamic, Java, Smalltalk | Leave a Comment »

Why dynamic-typing? (2)

Posted by Mark on August 27, 1997

Follow on topic “… actually, you could have both, couldn’t you? …”

Posted in Dynamic, Java, Smalltalk | Tagged: | Leave a Comment »

Why dynamic typing?

Posted by Mark on August 27, 1997

Why use dynamic typing for programming languages like Smalltalk, Ruby, etc. and what are the effects of that dynamic typing on application stability. Back in the mid 90s, the emergence of Java ‘opened’ the topic because Java was clearly more dynamic in typing than C++ [primarily through the ‘interface’ mechanism] but not nearly as dynamic as Smalltalk [which was a very active language in some circles at the time]. Now that Ruby has become mainstream as a kind of rebirth of Smalltalk into an updated world, this topic may be interesting again.

Posted in Dynamic, Java, Ruby, Smalltalk | Tagged: | Leave a Comment »