Smalltalk - Introduction and description

Smalltalk is an object-oriented programming language, a large class library and an interactive programming environment all in one. 

While this is true, it does not explain why Smalltalk is so quick to excite those who get to grips with it. Java or C# are also object-oriented programming languages, have partly very extensive class libraries and interactive programming environments and have been standard for some years.

The strengths of Smalltalk

The features of Smalltalk as a programming language and environment described so far result in some important strengths in favor of using Smalltalk in practice.

Smalltalk allows the simple and flexible modeling of concept hierarchies, which follows the classical pattern of stepwise refinement from the general to the specific. This makes Smalltalk an ideal prototype for modeling business knowledge.

Smalltalk is a mature, high performance and scalable system that allows "write-once-run-everywhere" execution and has been since the early 80s. The choice of available platforms depends on the vendor and in the case of VisualWorks from Cincom covers all current workstations from PC, Mac to the various Unix/Linux flavors.

In the context of Smalltalk, eXtreme Programming has been developed and Smalltalk is certainly the most productive of the XP development environments.

Smalltalk can show its strengths especially in an environment with a high frequency of changes. The integrated incremental development environment together with the flexibility resulting from reflexivity and implicit typing allow fast modifications that can be verified at any time and rapid development cycles.

In the sum of all its features, of which we have mentioned only a small set here, Smalltalk and especially Cincom Smalltalk is recommended for the development of complex and multi-layered systems that need to be continuously adapted to a changing world.

The Smalltalk programming language is purely object-oriented, reflexive and implicitly typed. This practically means that Smalltalk allows completely different programming than other OO languages derived from procedural languages such as C.

Pure object-oriented means that every value and every data structure is an object. We do not know in Smalltalk the distinction between literal values like numbers, characters or strings and objects, which is made for example by C++ and its descendants. The expression '23' creates an instance of the class SmallInteger, which is derived from the class Object via a short hierarchy. Thus, the number 23 understands all messages defined in this hierarchy and one can also implement new methods in the SmallInteger class. Similarly, one creates arrays not by a dedicated syntax, but simply by a creation message to the class Array, e.g. 'Array new: 4'. Pure object orientation avoids artificial distinctions between values and objects, which are difficult to motivate.

Reflexive means that Smalltalk is implemented in Smalltalk. The objects defining the Smalltalk language are themselves described with the means of the language. Therefore, classes and methods are themselves Smalltalk objects again and do not simply merge into the generated program when a class is translated. This also makes our above example 'Array new: 4' becomes clearer. The class Array is itself an object, which can be addressed under its name and which implements among other things a method 'new:'. Using Smalltalk objects to define the Smalltalk system allows the programmer to extend both the language itself and the programming environment. To this extent, it is probably not possible in any other conventional environment.

An implicitly typed language does have types -- in Smalltalk, these are the classes of objects -- but the assignment of types to objects is done at runtime and need not be specified as a type declaration at programming time. This makes Smalltalk type-safe: it is impossible to crash a program by using a message that is not understood. The reflexivity of Smalltalk allows such an illegal situation to be recognized and handled within Smalltalk. This even goes so far as to allow the error case to be handled by programming the missing method, after which the 'crashed' program can continue to run. We do not want to go into the unsolvable but nevertheless (or maybe because of that?) with a lot of verve led discussion pro-contra type declarations. Smalltalk works fine even without explicitly declared types.

The reflexivity of Smalltalk does not stop at the language, however. The class library and the development environment are also completely realized in Smalltalk. Compiler, debugger and the browser system are Smalltalk programs and are usually available in source code. The browser is at the same time an integrated editor, source code analyzer and refactoring tool, which is currently unsurpassed in its possibilities. The lack of type declarations and refactoring has an interesting consequence for the classic "edit, compile, debug" cycle: there are no incomplete class definitions and therefore classes and their methods can be compiled independently. Programming in Smalltalk means building classes incrementally method by method. At any time, the partial class can be used and tested. This allows perfect possibilities for fast "Edit, Compile, Debug" cycles on source code level.