Smalltalk Sucks

September 23rd, 2004 by Jeff Leave a reply »

I hate Smalltalk, so I wrote something that will help any students in the godawful ECE373 course create a basic class framework. Download it here. (Right click and save the file to somewhere, then upload it to a UNIX machine. ECE users can ssh to shell.ece.arizona.edu)

Then, to unpack and run it:

gunzip makeSmallClasses.pl.gz
chmod 700 makeSmallClasses.pl
makeSmallClasses.pl

Don’t specify an existing file as output, or it will be overwritten. Specify a file with extension .st and you will be able to “file it in” to Smalltalk.

It won’t write the meat of your code for you, but it will do the tedious stuff for you.

5 comments

  1. Which Smalltalk implementation are you using?

  2. Jeff says:

    I believe the lab I’m working in is using a Visualworks 7 flavor.

    Seeing the camp you’re from, I suppose I should explain myself. My university (University of Arizona) has a required class for computer engineers called “object-oriented software design.” Everyone in the class already has a solid base in Java, and most have coded in a few other languages too, but Smalltalk is completely new to us.

    My initial problems with Smalltalk had to do with the syntax. Compare it to modern languages, where “” are used to delimit strings, and assignment is a simple =, and order of operations is done like we were taught in basic mathematics courses, and it’s easy to see why that part of the transition is a bit rocky. Okay, so there’s some different syntax; I can handle that.

    Then I had to learn that Smalltalk wants to see each method in its own window, class declarations here, variables there, class-calling code in a workspace, and don’t forget to check the Instance/Class tabs before you create a method or you might create the wrong type! Okay, so Smalltalk distributes its code over a large area. At least I don’t have to declare methods.

    The real trouble lies with creating a basic class with accessors and a nonstandard instance creator. Now all of a sudden you have to enter in a LOT of text, in several windows. This is where it gets confusing for us. We have to start from scratch.

    So you create a group, and a class using the mouse; no problem. Then you have to know to change the inheritance to “Core.Object” (why isn’t this the default?) AND set up any class and instance variables in THAT file. THEN you have to add methods to access and set each variable. And then finally you can get down to the actual real programming.

    For all its prettiness and fluff and multiple windows, VisualWorks does nothing to automate this fundamental, yet mundane task. Give me a simple way of adding a class with instance variables x, y, and z that I can set and access through default methods that get created when I make the class. Then if I don’t want them (for instance, if I want the variables to be private) I just click and delete. I couldn’t find anything to automate this within Visualworks.

  3. Jeff says:

    I suppose I have another beef with how classes I create get chunked in with the rest of the language in a sort of code soup image file, but I guess that’s just something inherent to Smalltalk. It’s one thing if you’re working on your own computer, but if you’re in a laboratory, half the time you’ll come upon old pieces of other people’s homework assignments that got saved into the language when someone hit “Save your work” upon exiting. Apart from the obvious problem of code theft, it just makes things really messy should one ever have to reinstall the VM. Forgot to export your code? Whoops, there goes 3 weeks of thesis work. And that’s just counting benign problems… how do I know another user with regular privileges hasn’t deleted, or worse, overwritten core classes to harvest my keystrokes? If this isn’t an unfixable problem related to the language itself, then VisualWorks needs to AT LEAST save changes to the default image in a user-specific directory.

  4. In the Browser: Class – New

    Automates the whole thing.

  5. Reinout Heeck says:

    The setup at your lab is utterly broken, hop over to the vwnc-list if you want to know more ;-)

This work by Jeff Hiner is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported.