        |
Special Note for Experienced Programmers
Hi programmers, welcome.
This page ultimately will help those who are already familiar with the rudiments of programming in some "traditional" language.
Here are some issues to be addressed.
- The distinction between Squeak-as-Smalltalk, and Squeak-as-Etoys, and the confusion this causes.
- This book focuses exclusively on what can be done in the latter, using the drag/drop tiles and scripting language of etoys that is written on top of squeak-smalltalk. Most educators mean this when they say "Squeak". I believe that, modulo some shortcomings, this is one of several excellent environments for programming. (My other favorite is Microworlds Logo, which I would be pushing harder if it were free.)
- Is this "real" programming?
- The answer will be "yes". I believe Squeak offers a perfect introduction to programming that will ultimately help the beginning programmer understand Java much better, for example.
- Can you progress smoothly from Squeak to Java, or to Smalltalk?
- This has a complicated answer. I think Etoy programming sets a great foundation, but at present there is not a "smooth" transition "grammatically" from Etoy programming to anything else. More later.
But How do I....
Confusion in learning etoys/squeak arises from several factors:
- Your mindset. The things you want to try to do right away may not be the most natural things given the available primitives. E.g., binary search. Factorial. Average two numbers. Bubble sort. My advice is to give it up for now, this is not the best path. But, if you must, here are links to iterative binary search algorithm, to GCD computation, and to a recursive factorial program. (Document projects and insert links!)
- Documentation. Hopefully, we're addressing that here.
- Random bugs. There is/will be a section somewhere on random things that go wrong, including lost objects, frozen screen, blah blah.
- Where to look. There are many places to find things, and you want to explore them all. It would be nice if there were sharper barriers between etoys and underlying smalltalk. At some point, I'll list here a guide to where to look, and whether it is "basic" up and running material, whether it is "advanced" etoys stuff, whether it sits on boundary with underlying smalltalk, or whether it really should be avoided (unless you're learning smalltalk, in which case you're in the wrong place.)
- The overall flow of control, the global ticking clock, how parallel processes are handled, how scripts can call eachother, start eachother, insert eachother, pass variables?. There are some really nonintuitive things. See material elsewhere in this document (link to be inserted soon).
Fine, fine. But really, How do I...
Here is a table giving standard terminology, concepts, programming constructs, within Java/C/whatever, and Etoys:
One day, table will be made. Example: methods=scripts. arrays=holders. Bounded iteration via multiple script chaining and external initiliization, or alternatively, Robert's changeset (latter with warning). Recursion via "myHelper" creation and use of local variable in lieu of parameter passing.
Confusing Things.
These things were initially confusing to all of the people who know how to program and looked at Squeak....
- Scripts execute either exactly once, or go on forever. There is no primitive for bounded iteration. The way concurrent processes execute, and scripts start/stop is not inuitive without the proper mental model. (Example:
Script A
stop script A
start script A
is not an infinite loop. But
Script A
start script A
stop script A
is an infinite loop.
- Math executes right to left. There are no parentheses. Few math functions are available. If you are keen on doing math, think temporary variables and multiple lines of code.
- There are so many places to look... where should I, and where shouldn't I?
- This has a longish answer. Best to skim through the book, and see the order that things are introduced and not introduced.
- How do I process data? Where is it stored, how do I output?
- Squeak (not etoys) has file I/O, but etoys doesn't (that I know of). You can store information in text boxes, or in a holder which is an array like object, but the former suffers obstacles of accessing, parsing, indexing the information, the latter (lesser) obstacles because holders typically hold graphical objects, not numbers or text.
storing numbers, you need to
- I know. Here are answers to make it go easier for you.
Initially, there is a frustrating sense of powerlessness.... How do I write code? All scripting is done via drag-and-drop of premade code tiles. After awhile you get used to the inteface, you learn where to obtain tiles you need, and you learn quickly how to compose new tiles by taking bits and pieces of existing tiles. While this is cumbersome for the advanced programmer, it has many advantages for the beginner. Syntax errors are impossible. One undergraduate student who learned etoys commented that he was glad he learned this before his interview with Microsoft, because rather than just typing code, it made him think first about which objects were related to which others in which ways (you need to do this to fetch the appropriate tiles). While this perhaps speaks to our department's failure to teach him proper design in traditional courses, it does underscore that programming with etoys encourages thought about the meaning of programs.
- Here are things that are just plain annoying or hard to do, and are dying for an easier way (any volunteers?)
More later.
Links to this Page
|