View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Discussion 3 - Peter Budny

In detail, describe a problem that you experienced in Squeak. What was the problem? Why did it happen? How did you eventually overcome this problem?

I have many issues with Squeak. For instance, it is weakly typed, but in 99% of cases objects are written with the expectation that they will have one particular type of object in a variable, and putting anything else in there will break them. The UI is great because it is completely interactive, but it can be so buggy that it is difficult to work with. Objects have confusing methods and scarce documentation. Squeak proclaims to be well-designed from a UI perspective, but it ignores mouse-button labels that have in inherent ordering (left, middle, and right) for names which could be in any order (blue, red, and yellow). It also disregards compatibility with what users already know by forcing users to use Alt-C and Alt-V for copy and paste on Windows, rather than the Ctrl commands they expect.

However, in terms of an issue I was able to overcome... since fonts are unique based on their name and size, you cannot say "take this font, and change its size"; you have to get a totally different font. But fonts have a preset list of available sizes, so you cannot just ask for a font 1pt smaller. However, fonts have an ability to return a list of all the fonts in the same category; that is, all the fonts that are the same typeface, which will differ by heights. You can get this list, and then collect a new list that contains the heights. Then you can take your existing font, get its height, and find an index into your list of font heights. Now you know that your current font is the 4th one when ranked by size. Then you just move up or down by one size. This gives you the height of the next biggest or smallest font. You then ask for a font of the correct typeface and the height you just calculated; there is a constructor just for this.

In detail, describe a feature of Squeak that you have found particularly useful. What is the feature? Why is it useful? How do you envoke it?

By far, the best thing about Squeak is the interactivity of the environment. Not only do you have an environment where you can execute bits of code anywhere, like LISP, Scheme, or other REPL environments, but you can also look under the hood of any running object and see how it works. Workspaces, for instance, are very useful because you can put any code you want in a Workspace and try it out. Alt-P is also a very handy tool. (Compare the Java equivalent: add a System.out.println(), recompile, execute. That's like 50 keystrokes minimum.)

Overall, though, I will still pick this feature to tout: the Inspector. It's like having a debugger than can run on any object at any time, while the object is running. Forget having to put code in a Workspace and execute it; if you want to know the value of some object's variables, just use an Inspector. The Explorer is also useful; it displays the same information as an Inspector, only in an expandable tree format, so you can look at values that are objects without opening more windows. But the way some objects get turned into trees is a little funny, and sometimes not very useful.

In case you don't know, Inspectors are easy to open. If you have a running morph, you can bring up its halo buttons, and the gray wrench icon has an option to open an inspector. From a Workspace (or anywhere you have text) you can highlight some code that will return an object (so either a variable name, or some code that evaluates to an object) and press Alt-I to evaluate the code and open an inspector on the result. You can also send the message "inspect" to any object, so you can take your block of code, add "inspect" at the end, and use Alt-D to just doit. (Using Alt-I would open an Inspector on the Inspector!)

Links to this Page