A Brief Introduction to Smalltalk
written by Peter William Lount
Version 2, Revised 20040907
Version 2, Revised 20040908, 8:44am PDT
The simplicity, effectiveness and elegance of Smalltalk comes from it's
simple yet highly expressive syntax and the design of it's various libraries
of 'objects'. Smalltalk was the first, and remains one of the few, pure object
systems, which simply means that everything in a Smalltalk program is an object.
Smalltalk is generally recognized as the second Object Programming Language (OPL)
(after Simula and "object" influences from Sketchpad, the B5000 and the 220 File System, see
Early History of Smalltalk, Section I
), the first Pure Object Programming Langauge,
the first true Integrated Development Environment (IDE), and the first IDE that eliminated
the "Edit-Compile-Link-Run-Test-Debug" build cycle by integrating them all together so that cycle turn around time
can be measured in seconds and all phases can be active at once - true interactive development!
All of these features and capabilities have significant positive implications and important benefits.
An object is a collection of data grouped together in meaningful ways with
related operations, or chunks of programs, that manipulate that data. It is
suprising how well this way of organizing software works. Objects get work
done by sending 'messages' to each other. i.e. In english this would be
like Jill saying to Jack, Jack drop the ball please
. In Smalltalk this
might be written as jack dropTheBall
. Communication via messages is
something that we're all familar with in our lives. Messages can be thought
of as 'verbs' that ask the receiving object to perform an operation. Messages
may have objects as parameters. i.e. In english this would be like someone
saying to Jack, Jack pass the ball to Jill
. In Smalltalk this might
be written as jack passTheBallTo: jill
or even more flexibly as jack
pass: theBall to: jill
so that other objects, like aPen
, can be
passed around. A nice example of accomplishing more with less.
Smalltalk has a powerful concept known as "blocks" which are snippets of
program code that are also treated as objects, this enables them to be used
like any other object. In addition blocks enable you to extend the Smalltalk
language very easily in powerful ways that other popular languages only dream
Smalltalk was designed to be easy to learn and use. It is an expressive
language that uses a simple sub set of human languages, nouns and verbs.
Something that all humans can related to. This faciliates a clean expression
of solutions that map very well with human thinking. This is one of the compelling
reasons that Smalltalk programs tend to be one third to one half the size
of programs written in other popular languages
. Smalltalk programs typically
can do two to three times as much work for the same amount of code. Often
Smalltalk programs can actually do a lot more with much less code. Less code
to write, re-write, test and maintain means a lower cost of development,
a faster time to market, and potentially a higher quality of system which
lowers maintenance costs again and opens new opportunities.
The bottom line is that Smalltalk can work for you by letting you focus
on your solutions and the rewards of your business endeavours.
1 9 9 9 - 2 0 1 0 b y S m a l l t a l k . o r g "! , A l l R i g h t s R e s e r v e d .