Monday, February 2, 2009

Smalltalk for a Year - Status Report 1

As I've mentioned, I'm working on smalltalk as my learn a language a year language. So where am I after a month?

My initial idea was to ease into things using etoys as a gateway drug. But after a week or so I decided that, while it's oddly fascinating and kinda fun, it's not really smalltalk per se. So while I'll probably dabble a little bit, I've decided that I need to work with more mainstream smalltalk learning.

In that vein, I'm reading Squeak By Example and am about 1/3 of the way through. It's a very nice no nonsense introduction to smalltalk the language and squeak the environment.

After that I'm thinking I'll either look at the Squeak Development Example for Squeak 3.9 tutorial or work on a Seaside Tutorial. I'm sort of leaning towards the latter, but I'm sure I'll eventually do both, but for some reason I'm more drawn to the web development aspect of things these days. And how cool are you if you use continuations? (Pretty cool, I'd wager)

I have to confess that already in the first month I've had to fight off the the urge just to ditch this project. I'm a little embarrassed to admit that I'm not immediately overwhelmed with a love for smalltalk. And logically that's not really so unexpected. Learning a language is *hard*. And in the initial phases you basically see everything with your blub colored glasses and in the new language you see blub features but they are distorted and some blub features are completely missing or almost too awkward to be usable. You may dimly see some features that are interesting but they are obscured by an alien syntax and semantics.

And that's where I am now with smalltalk. There are somethings that seem interesting (elegant metaclass programming features, turtles all the way down, highly integrated development environment, etc) but I've never used these features "in anger". So at best they just seem kinda interesting. On the other hand the lack of modules feels archaic, the default user interface look-and-feel seems oddly clunky, the lack of list access syntax (e.g. foo[3:5]) makes me sad, and I miss emacs.

So I'm in the no man's land right now. I see things faintly off in the distance that seem interesting but everything in my reach is (seemingly) inferior and awkward.

I guess it helps me to lay it out like this. I'm surprised (even though I should know myself better by now) at how easily I could just abandon things and jump over to haskell for a while. Oooh, and then lisp is kinda cool, and then, oh yeah, I heard javascript is the NBL, I better look at that for a few minutes today.

I wonder if it's harder to fall in love with another language when your day job is python. But I'm a little afraid that python has become my blub and I must fight the tendencies of a blub programmer to be blind to non-blubby goodness.

Ok, enough dithering. I'm putting my blinders on again and focusing on smalltalk. I actually hope (and somewhat expect) that I will get over the oddness hurdle and really love smalltalk.

But it's not love at first sight. It's more like cautious optimism at first sight.


Julian Fitzell said...

If it's any consolation I don't think anyone much falls in love with Smalltalk at first sight (at least, not if they're coming from some other language). As you say, it's just so different...

I made two attempts to get into it but could never work my head around how deployment and source control worked and so on. Eventually I had a friend (who was already hooked) come over and spend an hour showing me why the tools really rock and basically from then on I was a convert.

Sounds like you're working with Squeak. Have you discovered Senders (alt+n), Implementors (alt+m), and Class References (alt+N) yet? That alone is reason for me never to leave a Smalltalk environment again.

And "foo copyFrom: 3 to 5" isn't so much worse, plus you can actually override it on your class if desired.

By the way, try opening a "Method Finder" from the Open... menu, put in "#(1 2 3 4 5). 3. 5. #(3 4 5)" (without quotes) and press enter. Or for a simpler example, try: "2. 2. 4". It will give you every method in the system that can be called on 2 with the parameter 2 and produce 4. Smalltalk rocks! :)

dustbunny said...

I've always thought that having a smalltalk expert around would be a huge aid in learning. Alas I'm not so lucky.

MethodFinder is definitely another one of those gems that keep me inspired to persevere. But it will probably take a case where I'm really stuck on something and then it saves me to really fall in love with it and not just think, hey neat.

I think the bottom line with smalltalk is that it *seems* like it should be easier. The language syntax is so simple in regular. But the environment is quite deep. So many key strokes to learn. So very many classes in the image. You really have to keep a bit of tunnel vision or else you can get overwhelmed.

I mostly just needed to give my self a pep talk. I am ready to keep diving in again.

Julian Fitzell said...

Agreed about the tunnel vision. It's tempting to keep following the code until you're into the debugger and the compiler and the exception handling and, and, and...

There's a huge amount of interesting stuff there (and some terrible, terrible code I'm afraid) and it's great fodder when you decide you finally want to understand a new part of the system but it can definitely feel overwhelming.

It definitely does seem like it ought to be easier. The Pharo project is working on just that. You could give it a try, though it still has some pretty rough edges and is changing very rapidly.

dustbunny said...

I definitely see pharo in my future. I'll most likely stay with squeak for at least a few months. Partly because if nothing else it's stable and predictable. And all the tutorials I'll be going thru assume a squeak environment.