A language that doesn’t affect the way you think about programming, is not worth knowing.
Cuis-Smalltalk —in short, Cuis— is a portable environment for doing, building and sharing software. Like any other tool, Cuis doesn’t require having a particular mindset or following a particular process. However, Cuis is built with a specific view on what software is, and what it means to build software. As a consequence, Cuis is especially effective if these ideas resonate with you and, at least occasionally, you let them guide your thoughts and actions.
In this book, we will accompany you as you explore, discover and learn about Cuis and Smalltalk.
We don’t assume knowledge of computer programming, but if you happen to have some experience with an Object-Oriented or Functional language you will recognize many concepts. If you don’t have any programming experience or you have coded in an imperative, closer to the metal language, such as C or Assembly, many of the ideas may be new.
In any case, especially during the first chapters, read this book and follow the examples with an open mind. A new point of view on what software development means will be an enriching experience. For us, programming is a thoughtful process.
We understand software development as the activity of learning and documenting knowledge for ourselves and others to use, and also to be run on a computer. The fact that a computer can execute the software and produce useful solutions to some problem is a consequence of the knowledge being sound and relevant. Just making it work is not the important part!
These ideas strongly shape Cuis and the experience of using it, and we’ll develop them further along in this book. Amongst their most obvious consequences are a passion for reducing unneeded complexity, while providing a complete, live software development experience.
This book is an introduction and invitation to explore Cuis. We hope you will join us in this journey to use Cuis as a medium to express ideas and thoughts, to build cool stuff, and to make Cuis even better.
To make your journey with this book more enjoyable, the Spacewar!1 project is its recurring theme. It is distilled into the book in code examples, exercises and dedicated chapters. At the end of the book, you will have written a replica of this historic video game. The final Cuis-Smalltalk package of this game can be downloaded from the book repository2.
The reader can study Cuis-Smalltalk from two versions of the book:
The chapters come with many examples. Some can be copied and pasted into Cuis-Smalltalk. We encourage you to do this, and in the process modify them to explore on your own.
The code examples in the online version can be directly copied and pasted into Cuis-Smalltalk. This is why the assignment character “←” you see in the developer Cuis-Smalltalk window is printed as “:=” in the online version of the book. The same applies with the return character “↑” printed as “^” in the online version.
In the offline PDF version, the code examples are printed with the same assignment and return characters as seen in the Cuis-Smalltalk windows. Copying and pasting also work as expected.
Other examples are code extracts which are not self sufficient to be executed as is. Their purpose is to expose specific facets of the Smalltalk language.
A typical example without a caption looks like:
The same example with a caption appears with a number and title, and can be used as a reference elsewhere in the book:
100 factorial ⇒ 9332621544394415268169923885626670049071596826438162146859 29638952175999932299156089414639761565182862536979208272237582 51185210916864000000000000000000000000
There are also a lot of exercises. Most are very easy; they intend to give you an opportunity to apply what you have just learned.
Exercises are easily identified by the Cuis-Smalltalk mascot: Cuis, a South American rodent!
Search the Internet: How many versions of Smalltalk are there?
The solutions to the exercises are presented in Solutions to the Exercises.