I finally did finish that project on time, and it appears I owe Mr. Robertson here an apology. VisualWorks does, in fact, have a way to automate class creation; I just didn't look hard enough. So I'll retract the topic of my previous posts. Smalltalk does not suck. I just don't have a good instructor to show me the ropes.
Smalltalk is different from Java just as English is different from Japanese. In fact, that's a pretty decent analogy; the "word order" is completely different. Whereas in Java I'd say System.out.println("Hello world"); in Smalltalk I'd say 'Hello world' printNl. In the first example, I tell Java's System class to do the printing. In the second, I tell the Smalltalk string to print itself. I suppose which is more intuitive is a matter of taste, and exposure. It certainly helps to have someone who
- knows what they're doing
- can teach the basics in a logical fashion
I think part of my frustration with dealing with Smalltalk stems from my professor's inability to explain the basic classes one needs to code anything in this new language. The other part stems from the fact that I expected Smalltalk to be codeable in a simple text editor. A simple text editor like TextPad or BBEdit is something that everyone who can code, if not everyone who can use a computer, is familiar with. Moving from that cozy single-document space into VisualWorks' multiple window interface with zillions of menus was downright intimidating. What's this "Workspace" and "Class browser" and "Transcript"? Where do I enter my code? Why can't I just type in a file with classes and compile/run it like in Java or C++ or Perl? Why isn't Smalltalk more like all these other languages I've already learned?
So for those of you Smalltalk devotees trying to convert the masses from other languages, your real first step is to explain slowly and patiently that Smalltalk is NOT like C++ or Java or Perl. Code is not always stored in its own file. Control and looping structures look completely different. Counting begins with 1. There are a bunch of other quirks. Things that are completely fundamental in many other computer languages are flipped about or turned inside out in Smalltalk. You must be prepared to answer the inevitable question: WHY is it done this way in Smalltalk? For instance, with every computer language I've learned since the age of 7, branching conditionals have always been in the format if (statement) then (expression). The best answer is the reverse question: WHY is it done that way in another language? The implied answer is that these pieces of computer language are arbitrary, despite years of convention in more popular languages. Being able to explain the mutability of computer language fundamentals is a good first step towards teaching Smalltalk.
Myself, I've got things like traditional for loops and if-then conditionals pretty much hard-coded into my brain at this point. I can read simple things like 1 to: 5 do: [:x | x printString], just as I can read many simple Japanese texts. But it takes a little bit more effort than reading for (x = 1; x < =5; x++) { cout << x << endl; } which would be the equivalent of English for me. Conceptually, Smalltalk is a beautiful programming language, but it takes me much more effort to write it than an equivalent C++ program. In the same way, the Japanese language has a lot of wonderfully elegant grammar, but it's so different from English that it takes me longer to compose a meaningful sentence. Do you catch my meaning?
So I don't think I'll ever just switch over to using Smalltalk, any more than I'll stop speaking English and start writing books in Japanese. The languages I use on a regular basis fill their niches quite well, and Smalltalk just isn't quite as intuitive to me as some folks tell me it should be. But don't take it personally, please; it's just because I've grown up on all the other languages.