On object infested APIs
An interesting discussion spawned on #pylons about the merits of Form Encode, a library to handle form validation. It has a nice API with decorators that will handle a lot of simple usage. But it's abstraction is leaky when one wants to use it for previewing or to do validation that needs to inspect more than one field. The way to make new validators is object infected. You need to derive from an existing validator to extend it. Since Python have closures, I suggested, an API where you add sub-validation with hooks would probably be cleaner for most usage. "Objects are an abomination before the Lord" replied Paul Snively (nick: psnively).
The Emacs API uses hooks all over the place. It's nice because you can add and remove stuff without changing the base code. And unrelated code can be inserted into a single hook which is hard to do with inheritance.
