I’ve been uninclined to start a blog for years, honestly. I mean blogs are a bit vain, aren’t they? Do I really have anything to say that the whole world needs to read? I think I probably squarely fit the mold outlined by this Kuro5hin post. In fact, I’d better do some more tweaking to the default MT template I’m using! (I did tweak it to embed my PhotoBlog on the right - gimme a break!)
Nonetheless, there have been some interesting posts lately regarding why people do or don’t use Smalltalk. It seems like those who disparage Smalltalk haven’t really done much Smalltalk, often making claims about Smalltalk that are patently false. What is it about Smalltalk (and Lisp) that people really resist?
I joined a team at my employer, Purdue University, a few years ago where development was done in VisualWorks Smalltalk. I had wanted to join the team years prior, but I was really resistant to the idea of doing Smalltalk. For one, it was just weird. I had seen the development environment and it was ugly and very WIMP-ish. I was very comfortable with text-editing, compiling, the usual Unix-ish development model. Yeah, I’d also done VB, Delphi, Powerbuilder, etc., but Smalltalk just seemed super-strange. I was also concerned about what kind of hit my rsum would take with an unknown number of years of Smalltalk on it. I decided to try and get on the team anyway since there were some really smart people working there.
Once I took the plunge and decided to defenestrate my preconceptions and learn to do things “The Smalltalk Way”, I have to tell you - it was like a religious transformation. Working in Smalltalk as a developer is simply better. Now before you ask what was in the kool-aid on that team, I think I can demonstrate why Smalltalk (and probably Lisp) is simply a better tool for writing software than nearly anything else available.
People are notorious for having a small “stack”. By stack, I mean layers of context you have to save to operate in successive modes over time. You’re working on the next great american novel. The detective is about to uncover the critical clue to solve the mystery. You get a phone call. So you save what you were thinking about the novel on to your mental stack. You talk to the caller. Then, you get a call on your second line. You put the first caller on hold. You save what you were talking about with the first caller on your mental stack, “on top of” the stack frame about the plot of your novel. You talk to the second caller. Your Palm Pilot beeps reminding you of your meeting with the publisher tomorrow. You save what you were talking about with the second caller on your mental stack so you can decide whether the Palm Pilot is indicating something of great importance about your schedule. By the time you turn off the Palm Pilot, hang up with the second caller, and hang up with the first caller, you’ve lost the plot of your novel off the bottom of your stack. If people try to repeat more than seven numbers from a random sequence, they fail. Small stack. Evolving as hunter-gatherers, we just didn’t have a lot of context we had to push and pop on and off of our mental stacks. Couple that with a small locus of attention and you realize we’re ill equipped to write complex software.
One of the things you learn in rudimentary user interface design is to avoid modal interfaces. A modal interface is one in which the user is restricted at some point to a limited set of operations before proceeding. Modal dialog boxes, once common in GUIs, are now widely reviled. Modal interfaces confuse the user, hide functionality, and are generally less efficient to use. It’s harder to develop a modeless interface from a developer’s point of view, but it’s generally recognized as the Right Thing To Do.
How does this relate to Smalltalk? Several ways. Developing in Smalltalk is modeless. By modeless, I mean that unlike, say C, you don’t have the edit-compile-run cycle. You don’t even have the edit-run cycle of, say, Perl. Smalltalk and Lisp (and dialects) are unique in that you can change the state of the running system from the running system. This is the modelessness of Smalltalk. You add/edit/delete a class or method, and you’re done. That’s it. The power of this model cannot be understated. There are no restrictions to what you can do at any point in the development process. Want to edit a class in C++ or Java? Shut down the system, edit, recompile, restart. Wanna change a string resource in Perl? Shut down the system, change, restart. Wanna make any change whatsovever in Smalltalk? Change the method/class, accept.
Additionally, in Smalltalk, everything is an object. Everything. Some people find this restrictive. I find it extremely liberating. Why? It gets back to the limited human stack and locus of attention. Because I don’t have to keep on my stack whether, like in C++, I’m working with objects, simple type declarations, functions (which are not first class), typedefs, etc. In Smalltalk, you have objects, you send messages to those objects. That’s it. It’s a nearly syntax-free language. This makes my small-stack, limited RAM brain very happy. I can focus on the work I have to do and not whether I need to dereference a function pointer or whether I should pass a parameter by value or reference.
Sure, as programmers, we tend to have to have particularly well-developed facilites for keeping deeper stacks and more information in our L2 brain caches. And I have done enough work in the languages on the Fortran trunk of the evolutionary tree of languages (C, C++, Java) to have developed these skills and get my work done. But having those types of skills is kind of like having to develop the muscles of a world-class bodybuilder just to be able to walk down the street. It’s wasteful. I want a language that caters to me and not the other way around.
Oddly, I’m not doing Smalltalk anymore (as of the last month or so). My employer is ditching our project and bringing in an ERP. I suppose it makes sense, but I miss the power and flexibility of Smalltalk already. I’m doing some Scheme work as a consulting gig, but it is, ironically, using a Scheme->C compiler, and so I’m on the edit-compile-run treadmill anyhow.
I find that my desire for modelessness reaches far beyond just programming. I modelessness is desirable for many of life’s endeavors. At some point I hope expound modelessness in text editors, religion, fashion, and maybe, if I can put the synapses together, music.