Australian Toolbook User Group

Toolbook Tips & Techniques

Previous Page Next Page


When I discovered Toolbook, almost 8 years ago now, I had a breakthrough in my effectiveness as a programmer. I also recaptured a sense of programming as pleasure.

Toolbook is one of the more prominent inheritors of the hypercard programming metaphor. The inventor of Hypercard, Bill Atkinson, was also the inventor of MacPaint – a graphics program whose interface metaphor is now commonplace. Hypercard (project Wildcard) was also an attempt to find a killer metaphor for programming.

These days (1998), the attempt to carve the conceptual continuum of automation and programming has resulted in hundreds of languages and authoring systems. For example - see

http://www.tiac.net/users/jasiglar/MMASFAQ.HTML

Other languages like Visual Basic (especially with it's Office 97 integration), Delphi 4 and Director 6.5 offer a real challenge to Toolbook. On the other hand, Toolbook was the most powerful system of its day - and it has continued to evolve itself. It may not be the best tool for all jobs, but it is good for many. It has a compelling metaphor you grow to love and some amazing features that make programming simpler and more exciting.



Occam's Razor

The main reason why Toolbook fascinates me is that the principle of Occam's Razor has been used extensively.

Occam's Razor generally means 'keep it simple'; if something is not necessary to the design, then leave it out. If there are two ways to do something, choose the simpler way. The principle is used by philosophers and scientists creating theories, and provides a much appreciated way of keeping theories from getting too complex, when they, in fact, don't need to be.

The sharp edge of Occam's Razor has been keenly applied by the designers of Toolbook. Every act of programming has been studied and boiled down into the simplest, most elegant metaphor.

Let me illustrate by comparing some C code which reads the contents of a file into memory with some Toolbook code that does the same thing:

/* --- C language code --- */
#define BUF_SIZE  32000
FILE *fp;
char buf[ BUF_SIZE+1 ];
int numReadIn;
fp = fopen("c:\cconfig.sys", "r");
numReadIn = fread(buf, sizeof(char), 32000, fp);
fclose(fp);
fprintf(stdout, "%s", buf);

Compare this to

--- Toolbook OpenScript code:
set fp to "c:\config.sys"
openFile fp
readFile fp for 32000
closeFile fp
put it

Notice the "cleanliness of the Toolbook code. Makes you want to sigh a breath of relief…

The Toolbook designers designed Toolbook's OpenScript language so that we use the file name to refer to the file – that's it, end of discussion, no need to introduce such extra notions as file handles.

The language C, on the other hand, requires that you convert the file name into a file handle and use the file handle in subsequent file references. Sure, there are good technical reasons why file handles are used – Toolbook even uses them internally, however the Toolbook programmer doesn't know about them because at the level of applications programming, they are excess conceptual baggage.

Are you getting the idea of Occam's Razor? Are you wondering just how much the razor of simplification can possibly trim out of a programming language? Just how simple can it get, without sacrificing programming power? Toolbook is a fascinating case study in this regard, raising all sorts of Computer Science and Language design issues

The futuristic ideas that the makers of Toolbook - Asymetrix, invested in their product are worthy of broad study and appreciation by all programmers.

More will follow…

-Andy


To access thousands more tips offline - download Toolbook Knowledge Nuggets 

Previous Page Next Page