Back to -Tutorials -Sapphire (Ruby In Steel) Tutorials -Programming

Ruby The Smalltalk Way

Download free books and software and follow our new series...

In this series, I plan to examine Smalltalk and Ruby in parallel so try to see a) just how similar they really are (or aren’t?) and b) whether or not it is possible to program Ruby “in a Smalltalk style”. In this introductory article, I’ll outline some of the themes and ideas which I’ll be considering in more depth later on and I’ll give you all the links you’ll need to download software and documentation to let you follow along with me...

This series...
- Part One: Fundamentals
- Part Two: A Question of Style
- Part Three: The World According To Objects

As I mentioned in a recent Blog post, the idea for this series came about after reading numerous comments in books, article and Blogs which take it for granted that Ruby is closely related to Smalltalk. And yet, while Smalltalk was clearly an influence on Ruby, the experience of programming in those two languages is, in my view, very, very different.

Why should that be?

Environmental Concerns

On the face of it, Ruby and Smalltalk are similar languages. They are both take a fairly rigorous approach to Object Orientation and even their syntaxes more closely resemble Algol/Pascal than C/Java.

So maybe the main difference is the programming environment? In Smalltalk, the language and the environment are so tightly bound that the IDE itself (its windows and graphics) can be manipulated in Smalltalk. Ruby, on the other hand, presupposes no environment and, even when it is provided with a dedicated IDE, the Ruby language has, so to speak, no ‘built in knowledge’ of its workspace.

In Smalltalk the IDE and the language are tightly coupled. On the plus side, this makes it possible for the language to manipulate its own environment and the environment to offer unparalleled support for the language. Programming in Smalltalk is more than just editing code into an editor. It is a process of browsing the class hierarchy and modifying the classes right inside a multi-pane Hierarchy Browser. There are tools to inspect objects, find methods and locate implementers and so on. Implementations of Smalltalk (such as Dolphin Smalltalk, shown here) are built from the ground up to support that development of the language seamlessly - it’s not easy to see quite where the IDE ends and the language begins...

Ruby, on the other hand, was never built with an IDE in mind. Many Ruby programmers write code in a plain text editor and run the resulting program from a command prompt. As a result, the development experience is far removed from that of Smalltalk. Even if you use an IDE, such as Ruby In Steel, the ‘join’ between the language and the environment won’t be as seamless as in Smalltalk. On the plus side, this means that Ruby programs are more easily portable (they aren’t ‘welded into’ their own hermetically sealed programming world) and they allow you to pick your own development style (you aren’t obliged to work inside a Class Browser and move from branch to branch in order to modify an existing class hierarchy).

Fundamentals Of Smalltalk

In this series, I’ll be looking at a number of features of the ‘Smalltalk way’ of programming. For example, I’ll be considering why, in C, Pascal and most other mainstream languages, it is normal to ‘call functions’ while, in Smalltalk, you ‘send messages’. Is ‘message sending’ just another way of saying ‘method calling’? Or is there a meaningful distinction to be made between these two paradigms?

Another thing I want to consider are the class hierarchies of Ruby and Smalltalk. Ruby, in common with other OO languages such as C#, has a shallow class hierarchy - that is, there are few branches on the family trees of most classes. Is that a good thing, a bad thing or of no real consequence?

But ultimately, the important question I want to address is: given the differences in coding styles typifying Smalltalk and Ruby, is it possible to write Ruby programs in a ‘Smalltalk style’. And, if it is possible, is it desirable?

The Smalltalk Course Book

In this series, I won’t assume any previous knowledge of Smalltalk. In order to give Smalltalk newcomers some background reading material and, moreover, to provide a structure for the series itself, I’ll be constantly referring to a little tutorial which was written for a commercial Smalltalk product, Smalltalk/V. You can think of this as the ‘course text’ of the series. The Smalltalk/V tutorial provides an easy introduction to the fundamental ideas of Smalltalk Once again, the download link is at the end of this article.

What Next...?

In the next part of this series, we’ll be getting down to some real work with hands-on programming and sample code in both Ruby and Smalltalk. If you want to do some preparatory ‘homework’, you might like to glance through Chapter One of the Smalltalk/V Tutorial.

If you are new to Ruby, you should first make sure that Ruby is installed. You can either use Ruby with a programming editor of your choice or, if you are a Visual Studio user, you can download a copy of the SapphireSteel Ruby IDE, Ruby In Steel. You may either use our free Personal Edition, the commercial Developer Edition or the free 30-Day Developer Trial.

For a simple introduction to Ruby programming, download our free eBook, The Little Book Of Ruby, complete with all the source code of the sample programs (available for download on the same page). If you plan to follow along with the Smalltalk code too, you may want to download the free Community Edition of Dolphin Smalltalk. If you are new to Smalltalk you may want to read my Beginner’s Tutorial on Dolphin Smalltalk which should help you to become familiar with basics of the Smalltalk language and environment.

Most of Smalltalk code which I’ll provide in this series should also work with other versions of Smalltalk such as Squeak (if you use this, you may want to read my Squeak Tutorial first) or Cincom VisualWorks. However, I’ll only be testing my code with Dolphin Smalltalk, so I don’t guarantee that it will be fully compatible with other implementations.

Useful Links


- The Smalltalk/V Tutorial [Direct Link] (the ’course book’ for this series)

This book is hosted by Stéphane Ducasse’s :: Free Online Books, and you may want to visit that page to download other useful Smalltalk books. In particular, two other books to which I shall occasionally refer in this series are: Smalltalk An Introduction to Application Development using VisualWorks by Trevor Hopkins and Bernard Horan and Smalltalk by Example: the Developer’s Guide by Alex Sharp.

- The Little Book Of Ruby my free beginner’s eBook (with source code) to the Ruby language.

Beginner’s Smalltalk Tutorials (online)

- Tutorial on Dolphin Smalltalk
- Tutorial on Squeak

Ruby In Steel

The SapphireSteel Software Ruby (and Rails) IDE for Visual Studio
- Ruby In Steel Personal Edition (free)
- Ruby In Steel Developer Edition (buy)
- Ruby In Steel 30-Day Trial (time-limited)

Smalltalk Implementations

- Dolphin Smalltalk Community Edition (recommended for this series)
- Squeak
- Cincom VisualWorks

Bookmark and Share   Keywords:  ruby  smalltalk
© SapphireSteel Software 2014
buy modalert buy generic duprost levipil buy armodafinil online buy generic omeprazole order suhagra buy qutipin buy tadalafil online buy tadalafil modvigil 200mg buy generic bortenat zhewitra for sale buy olanzapine buy arpizol ketasma attentrol tadarise pro 20mg buy tadalafil 20mg buy poxet 60mg buy generic gefitinib modafresh for sale vidalista tadalafil buy avanafil 100mg order irovel buy erlotinib online order sustanon admenta memantine buy cernos gel bupron sr buproprion order sildenafil citrate buy generic topirol tadacip for sale premarin conjugated estrogens buy generic quinine sulphate buy avanafil order terbicip buy prostaglandin 3ml buy azithrocin 250mg buy vardenafil online buy generic atorvastatin phenytoin sodium buy armod buy femalegra amlodipine besylate order natamet melanocyl for sale verdenafil buy sildenafil citrate 100mg buy malegra buy tadalafil 20mg amlodipine nodict 50mg buy pletoz buy sildenafil citrate oral jelly online order avana buy ciplactin 15mg buy tenofovir online buy calutide 50mg buy viagra buy imatinib buy generic calaptin buy urimax 0.4mg caverta 100mg fertyl for sale order malegra fxt qutipin sr quetiapine buy fluconazole 200mg nitazoxanide piracetam hostacycline for sale buy isotretinion tretinoin buy mirtaz online flagyl buspin for sale buy amitryn online bactrim d.s for sale order generic ampicillin buy cabergoline online buy snovitra 20mg cutivate cream sildenafil citrate cialis super active 20mg cernos depot buy generic rogaine shampoo generic imatinib 100mg buy prosteride online finasteride 1mg aldactone tenofovir + emtricitabine for sale buy generic baclof buy tadaga buy generic fertyl super esomeprazole for sale buy sildenafil citrate online arcalion sulbutiamine for sale buy flonida online buy megalis online mestilon mesterolone order vega buy prexaton 150mg buy generic fincar buy generic tizan generic nuvigil 150mg buy floricot sildenafil citrate jelly for sale buy imatinib cenforce order andriol buy generic lenalidomide buy fluka online buy generic vardenafil kamagra 100mg rapamune buy sildigra xl plus online fluticasone 0.05 % 90 gm buy namenda 10mg vardenafil 20mg order enalapril maleate ciprofloxacin 500mg malegra dxt buy generic malegra professional buy naltroxene 50mg flagyl 400mg buy sirolimus order acamprol simvastatin buy biduret buy lasix viagra orlistat xenical buy lioresal 25mg waklert armodafinil buy apcalis jelly online super p force 100mg + 60mg buy bimatoprost opthalmic drops buy generic zenegra sulpitac for sale order piracetam pelosta buy anabrez online order super kamagra doxicip for sale buy avidoxy online buy sildigra sildisoft sildenafil citrate soft tadarise for sale buy viraday generic femara omnacortil prednisolone buy lithosun sr online cernos capsules 40mg buy generic rifagut buy rizact online diclofenac voltaren ranitidine for sale xtane 25mg buy sorafenib buy cialis buy x-vir buy lasuna buy rasagiline mesylate