Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
Discussion 3 - Brandyn Roemer
1. 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?
The biggest problem I've experienced with squeak so far is the poor documentation. The documentation inside the squeak environment itself is very inconsistent, and I've found that most of the time when I actually need or want to look at a class comment I end up with one of two problems. The first one being that I'm presented with the "THIS CLASS HAS NO COMMENT!" comment. A bigger problem (as well as an annoyance) though is that I'll often find detailed comments for things that are obvious or could be figured out fairly easily, and then end up with comments that lead me further and further away from what I'm trying to figure out when I actually need a comment to figure it out in a reasonable amount of time. One such example of 'misleading' comments is in the class comment for TextAttribute - in which you'll find the following:
Tells a piece of text to be a certain way.
Select text, press Command-6, choose a attribute. If selected text is of the form
Hi There<Smalltalk beep>
the part in angle brackets is saved for action, and the Hi There appears in the paragraph. If selection has no angle brackets, use the whole thing as both the text and the action.
TextDoIt – eval as a Smalltalk expression (the part in angle brackets)
TextLink – Show a method, class comment, class hierarchy, or class defintion.
<Point extent:>, <Point Comment>, <Point Hierarchy>, or <Point Defintion> are what you type.
TextURL – Show the web page. <www.disney.com>
These attributes of text need to be stored on the disk in a regular file-out. It is done in this form: Hi There
in the text, and a Run containing dSmalltalk beep;;
Click here to see the extent:
in the text, and a Run containing method LPoint extent:;
See RunArray class scanFrom: where decoding is done.
With the exception of the first line, the first half or so of this comment isn't all that bad. It at least made me aware of a feature I didn't know about. Then in the last half, instead of giving a simple code example of how TextAttributes can be used with a Text object to format its contents, you end up with something about storing attributes on disk and a link to something even less helpful. Even something as simple as the following line between the two parts above would have helped and saved a lot of time:
textEditor replaceSelectionWith: (selText addAttribute: attribute).
Which is actually similar to one of the last couple lines of code in the function that handles transforming a selected block of text based on which menu item you selected after pressing Command-6 (Do It, Print It, etc) - This is where the link should be to. I can't really say that I've overcome this problem - not permanently at least. The only solution seems to be just experimentation and exploring/inspecting existing objects.
2. Find two posts that you think are useful and explain why you found them particularly useful.
Discussion 3 - Chris Ronderos
I found this useful because it gives more control over what exactly is included in a changeset. Because of this, the amount of additional unused classes and garbage can be controlled when combining multiple changesets over time.
I found this useful because proper use of the method finder can greatly reduce the amount of time spent looking for methods with a desired functionality. The method finder, as pointed out on the page, can be used to either search for a method by name, or by arguments and responses. Searching for a method by arguments and responses will most likely narrow down results to something closer to what you're actually looking for than if you had just searched by name. It may also find methods providing the functionality you desire that have names you never would have guessed, and as a result, never would have found using the traditional search-by-name. (Also, unfortunately, given the way Squeak seems to be working/not working, I have a feeling that the problem and solution preceding the method finder part of the discussion on his page may come in useful at some point somehow)
While I found the overall idea of using private methods when nothing else can be used to accomplish some goal useful, I'm not quite sure why methods like privateAddMorph:atIndex: have to be used. In the case of adding morphs, there exist a number of non-private addMorph methods that do the same thing. Many of them just end up calling their private version (i.e. addMorphFront calls privateAddMorph:atIndex: with index of 1), but if this changes and they end up doing something before calling their private version, any code that directly calls the private version may not work or work correctly.
Links to this Page