I was thinking about why I hate frameworks. It’s not a full-on hate, of course, but I find that wrapping and abstracting every aspect of an approach insulates you from what you really need to understand. I call it the inverse law of elbows: the more elbows you add to something, the harder it is to get it to do anything useful.
So while my mind was wandering around the why-do-people-insist-on-frameworks question, I started thinking about what I do like. Here’s what I came up with:
- Engines (solve a narrow class of problem with a simple interface)
- Libraries (functions and groups of functions)
- Toolkits (larger groups of functions)
- Languages (alternate ways to describe solutions)
- Domain specific languages (solve small parts of your domain well)
- Concrete, simple implementations (just the straight dope)
- And, always, always, always consider standard/common things first
It comes down to choice, orthogonality, and the smallest number of immutable constraints on how you can put the parts together.
You can replace engines easily, based on their well defined, loosely coupled interfaces. You can take or leave portions of libraries and toolkits. Languages (outside of little languages) give you some level of choice. DSLs let you express things in your domain. And simple, concrete implementations give you things that work.
I’m going to work on posting links to some metaphors of products using engines, libraries, DSLs (and the like) really well. I’ve been inspired by dozens of things that other people have written, which have moulded how I see approaches.