Just about every school of Computing Science in the known universe has a course in first or second year called something like “data structures” that exposes students to several (sometimes many) techniques for organizing data in ways more complex than a simple sequence. There’s often a fat textbook with dozens of them, of which an instructor selects the two or three most important and a smattering of others.
The things is, most of those structures are special implementations of the abstract idea of a “dictionary”: given one of these, find one of those. Given a name, find a telephone number. Given a street address, find the GPS coordinates. Most of the ways of doing this have already been programmed hundreds of times, so some students wonder “why should I bother learning all this, when I can just reuse what somebody else has done?” They especially ask this if you’re showing them a particularly tricky piece of code from one of the cleverer dictionaries.
So how should we teach this material? Back in the late 1980’s, I thought about that question a lot, and came up with an answer I liked: Software design is about making deliberate choices among alternatives, and this is an ideal course for driving that home.
