Sunday, May 09, 2004

Legos and Jigsaw Puzzles

Toys.

An infant can pick up building blocks and with no training build something - just put one block on top of the other.

A toddler can use legos. Line up the "in's" and the "out's" and push the pieces together.

Jigsaw puzzles are trickier. Puzzles are packaged by the number of pieces they contain. Why? Because in a puzzle each piece has only 1 potential place in the puzzle (1 'in' matches 1 'out') and as the number of pieces increases so does the complexity.

Imagine a set of legos where the notches (or interfaces) were different on every block. Each lego only worked with one other lego in the set.

In software we see a similar problem. As the number of pieces (and interfaces) increase, so does the complexity of assembling the components. Some items plug in nicely while others require significant transformations. Scanning for the right component takes time -like scanning for a single puzzle piece in a 1000 piece puzzle.

Personally, I love the interface for the database. I believe whole-heartedly that the interface is what made it so damn popular. do(DDL) and do(DML) are absolutely beautiful. Something to create, destroy, administer and manipulate - and all done on a solid mathematical foundation.

Call me silly for not liking an operation called, "getLastStockPrice". Call me dumb for not being able to figure out the REST equivalent of the operation. For some reason the magic of the WWW feels like it comes more from HTML than HTTP. Is the real magic in the browser: do(HTML)? Is chasing the HTTP verbs a red herring? or just an obvious fact that when realizing a domain specific language you shouldn't screw it up with a complex API.

The web... simple addressing, simple verbs acting as manilla envelope; and a domain specific language that can describe everything from pornography to the weather, all working together to create the worlds largest distributed computing platform. Simple addressing, simple envelopes and DSL's.