Tombstone
ZTimeLine
Oct 2001 โ Jan 2002 ยท age 19โ20
What it was
A small C++ library, about five hundred lines, that modelled a schedule in three levels: a timeline held spans, each span was keyed by an owner and an action, and each span held slices with a start, a length and a weight. The whole public surface was one class and integers. The span and slice classes never left the implementation, and every call took and returned indices, so no object or pointer ever crossed the boundary. Spans stayed sorted by owner and action and were found with a hand-written galloping search; slices stayed sorted by start. Collision was offered as a question rather than a rule: ask what a moved slice would hit, skipping itself, and decide for yourself. Written in one late-night session, it built clean, and three months later was given away as free sample code under a license.
Wins, for the age
- At nineteen, Jeff drew a hard public boundary: a 71-line header over four hundred lines of hidden implementation. Windows handles and the pimpl idiom had long shown the way; this primate reached the same place before having a name for it.
- Made collision a query and left the policy to the caller, exactly the primitive the editor built on top needed to make a dragged slice slide instead of stop.
- Finished something. A release build, a kept log, a license, and publication, all for a four-day library.
- Left "why did I do this?, not sure" in a shipping header. A mammal who needed sleep, at the end of a very late night, chose honesty over tidiness, and the code is better for it.
What it taught
- Design a data structure as an API first. The header was written to be read, grouped into sections, with its invariants ("NO BOUND CHECKING") where a reader would see them.
- Derive every comparison operator from one three-way
compare. That pattern shows up in every container written later. - Hand-written containers hide classic bugs: an assignment that appended instead of replacing, a quicksort that read past a partition without a sentinel, closed intervals that made touching slices collide.
- A library tested only through the one editor built on it is barely tested at all.
Genealogy
Ancestors: Z Time Alloc: the editor whose needs shaped the collision query and the handle API. Descendants: Cauldron v1: owners, actions and weighted intervals, grown into composable animation channels.
Epitaph
Here lies ZTimeLine, seventy-one lines of header that hid four hundred of implementation, kept its doubts in comments, and was given away for free.