Sunday, April 26, 2009

My First Impressions of Smalltalk

As a disclaimer, I've only been using (Squeak) Smalltalk for a couple weeks, and haven't written anything major in it yet, so this is currently just my first impressions. But wow, what a first impression. The "turtles all the way down" object model is absolutely delightful to work with, and having the whole development environment so tightly linked is incredible. It's like going from a complied-only language to a language with a REPL and realizing how clunky and slow your development flow used to be: Having not just a repl, but a whole organic environment that you can play with and introspect into...The analogy that came to mind was that the difference between programming in Smalltalk and other programming in languages is like the difference between building a bridge and gardening.

I had briefly tried mucking about with Smalltalk previously, but my Emacs-centricism made me avoid Squeak in favour of GNU Smalltalk which, while doubtless a fine implementation, did not really demonstrate to me the joy of Smalltalk the same way Squeak does. Now that I've started to use Squeak a little more (went through "Squeak By Example", now in the process of trying to write some Seaside stuff), I'm starting to understand why Smalltalk is held up there with Lisp in terms of languages that smart people like.

For me, the hard part about learning Smalltalk was wrapping my brain around the idea of your all your code being in an image, as a series of living objects, rather than existing only in flat text files which are briefly given life when run, then filt out of existence. It was initially kind of hard to accept what seemed a disgusting loss of control: I want to be able to have all my code in front of me dammit, not scattered to the winds, where I have to use some kind of GUI Browser (gross!) to see my code, and even then only being able to look at one object or method at a time! I think I've come to realize, however, that this paradigm has definite advantages. For one, being physically unable to view massive blocks of code all at once forces you to write well-factored, conceptually-separated code right from the get-go.

I haven't had the chance to make anything real yet in Smalltalk, I'm thinking of starting to write some webapps using Seaside, which seems quite enjoyable...Smalltalk seems well on it's way to becoming one of my favourite languages—While I've been a Smug Lisp Weenie since high school, I think I may very well soon become a Smug Smalltalk Weenie :)

5 comments:

OMouse said...

Hey, for a Ryerson human-computer interaction course I had to code up a Squeak/Seaside app. It's relatively simple and I can upload the .image to my website if you want to take a look at the code. It was really interesting to develop with Squeak, especially with Seaside because I didn't realize how the processes/tasks would map out at first but then when it became more clear, it was ridiculously easy to add the classes and messages I would need.

If you're going to use Seaside, you should also (eventually) take a look at Magritte, the meta-description framework. Makes dealing with HTML forms much more pleasant.

James said...

OMouse: Thanks for the comment! That sounds pretty interesting, I would definitly love to take a look at your .image. I've heard of Magritte, and was planning to take a look at that after I figure out Magma. Thanks for the tips!

ddadmin said...

I went through many sites of the Smalltalk and agree with all the supporters of Smalltalk. Though Smalltalk is not that popular these days, there is a new renaissance in Smalltalk development, thanks to Squeak. The more I learn about Smalltalk and Squeak the more I’m impressed. If you are programming savvy it is worth a look. In the process of my learning I have collected some good sites (more than 200) related to Smalltalk and Squeak (lessons, tutorials and programming). If you are interested take a look at the below link.
http://markthispage.blogspot.com/2009/06/more-than-200-sites-to-study-smalltalk.html

Bill Six said...

Goddamn right.

sergio_101 said...

great to see some else discovering smalltalk! very cool.. about to launch my first major seaside app..