Home
Archives
About us...
Advertising
Contacts
Site Map
 

ruby in steel

 

Squeak : Learn Programming With Robots
by Stéphane Ducasse
A Press www.apress.com
ISBN: 1-59059-491-6
$39.99 / £27.99



for more information on this award, see HERE

‘Fun’ is not generally a word that springs readily to mind when you think of books about object orientated programming. Stéphane Ducasse’s Squeak: Learn Programming With Robots is an exception to the rule. In around 340 pages it explores the fundamentals of programming in Squeak Smalltalk in a way that feels decidedly more like play than work.

The basic idea is that the user conducts a number of programming experiments by issuing commands (or, in Smalltalk-speak ‘sending messages’) to on-screen interactive shapes (‘robots’ – or what used to be known as ‘turtles’). You do this by entering bits of code into a robot’s speech bubble. To make the robot move you might entering the message go: 200 causing the robot to jump 200 pixels in whichever direction it happens to be pointing at the time. You might then enter turn: 180 and go: 300, causing the robot to turn 180 degrees and move 300 pixels back in the direction from which it came. The examples in the book are run within a ‘robot world’ inside the free Squeak Smalltalk. This can be downloaded from the author’s site:  http://smallwiki.unibe.ch/botsinc/

Most of the programming ideas and principles discussed in this book are brought to life by using the robots to draw lines and patterns. In the course of so doing, the reader is introduced to the essential features of Smalltalk including loops, methods, class libraries and class browsers. While the programming environment is very simple (much simpler than the default Squeak interface) you can nonetheless do proper programming either by entering Smalltalk code into a specific robot’s speech bubble or into a ‘Bot Workspace’ window.


You can play with your robots in their own little world which lives inside Squeak Smalltalk. Here I am examining methods in a simplified 'class browser' and entering commands into a workspace window and 'speech bubbles' to make the robots move and draw patterns

The book is divided into five sections: Getting Started provides an introduction to Squeak and the robots; Elementary Programming Concepts covers things such as loops and variables; Bringing Abstraction Into Play looks at methods and arguments; Conditions examines conditional loops, Boolean expressions and so on; and finally Other Squeak Worlds looks at the eToy scripting system and the Alice 3D authoring environment, both of which can be used within Squeak.

Alan Kay (inventor of Smalltalk) contributes a fascinating foreword to this book in which he bemoans the lack of development of programming languages in general over the last few decades: “The level of expression in today’s programming is so low (really back around 1965 for most of it)…”; and of Smalltalk in particular: “Smalltalk has not changed appreciably since it was released as Smalltalk-80 in the early 1980s”. In the mid ’90s he decided to create a free Smalltalk (‘Squeak’) in the hope that programmers would use it as a tool for developing new languages rather than simply carry on programming in Smalltalk. In fact, it turned out that Smalltalk enthusiasts embraced Squeak itself:“I think it is safe to say that most of the Squeak community is dedicated to making this Smalltalk more useful and accessible, and not devoted to making something so much better as to render Smalltalk obsolete (a fate I would dearly love to see happen).”

The combination of the book and the Squeak-robot environment undoubtedly makes this a more entertaining way of learning to program than battling against the likes of C++ or Java in a traditional edit-and-debug IDE. While Ducasse’s original ‘target audience’ was the 11 to 15 years olds to whom his wife was teaching programming, this book is certainly not ‘just for kids’. It would also be a great book for an adult who wants to learn the principles of object orientation or find an easy route into Smalltalk programming.

I should add one proviso. I don’t think the book is ideal for someone who wants to learn ‘general purpose’ programming with the aim of moving directly onto a language such as C#, C++ or Java. While all of those languages are, to a greater or lesser extent, object orientated, I am not convinced that the Smalltalk way of describing OOP (for example, ‘sending messages’ instead of calling functions) is particularly useful or illuminating when working with one of the current raft of C-like languages. I note, however, that there are two additional chapters, available as a PDF downloads, which address syntactical differences between Smalltalk and other languages .

In conclusion, it has to be said that this book will not be to everyone’s tastes. Bear in mind that, it is not intended for proficient programmers. But for a beginning programmer or someone who wants an easy-to-understand entry to the world of ‘real’ object orientation, it would be a real treat.

You can buy this book at a discount from Computer Manuals (UK).

Huw Collingbourne

February 2006

 


Home | Archives | Contacts

Copyright © 2006 Dark Neon Ltd. :: not to be reproduced without permission