June 29, 2006
MarkBernstein.org
 

Dynamic Typing

In Tinderbox, notes can have prototypes. If a note has a prototype, then we're saying the note is just like the prototype except for the places we've explicitly changed it.

Often, people use prototypes to make an informal and evolving system of types. One part of our notebook becomes a ToDo list -- just a list of notes. It grows, and we make a few prototypes to simplify adding some common things -- Tasks, Projects, Appointments, Goals.

What people forget -- what I recently forgot -- is that there's nothing to prevent you from changing these types, either by hand or automatically. For example , in GTD a "task" is a simple, atomic ToDo, and a "project" is a collection of related tasks. When you're programming, though, a task sometimes turns out to be more complicated than it seems. It wants to acquire subtasks. It wants to be a project. We can recognize this with two simple rules:

Task: if(ChildCount>0){Prototype=project}
Task: if(ChildCount=0){Prototype=task}

Now, adding a subtask converts a task to a project, and removing the last subtask makes a project into a simple task. Simple!

You don't have to automate things like this, but it's nice to know the tools are there when you need them.