in reply to API complexity measures
are there any objective complexity measures for APIs
No, pretty much all of them are arbitrary to one degree or another. I think complexity is a really hard thing to measure for APIs. For instance a complex problem domain will necessitate a complex API and that is a good thing. IMO, a simple API over a complex problem domain very rarely works. It is either not powerful enough, because the compromises the author had to make for the sake of simplicity removed too many features/options. Or it is actually more complex because the author applied their own personal world-view/metaphor-model to the problem domain and you have to understand that before you can even think about using the API itself.
Personally I have always been a fan of consistency being a good way to manage complexity in APIs. A few years ago I got a book called Reusable Software : The Base Object-Oriented Component Libraries by Bertrand Meyer off of eBay. It sat on my shelf for a while until I found myself needing to write a large-ish set of libraries for $work, and not having any clue how to approach it. The book has lots of really good advice, but the thing that stuck with me the most was the idea of using consistency as a way of managing complexity. Not only consistency in class, method and variable names, but consistency in abstractions as well. Meaning that similar concepts should be broken down in similar ways and provide similar features.
A side effect of consistency is also that it can breed habitual behavior. Around the same time I read The Humane Interface by Jef Raskin and The Invisible Computer by Donald Norman, neither of which are about APIs, but whose deeper messages can be applied to API design. The core ideas I took away from them was that a good interface is one whose use can become habitual, thereby moving from a conscious act to a (partially) subconscious act. This is not to be mistaken for "intuitive" which basically means "well it makes sense to me, what are you so stupid that you don't get this". To me a habitual API is one where after using it for a while it becomes possible to make educated guesses and have them be correct a fair portion of the time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: API complexity measures
by Your Mother (Archbishop) on Jun 10, 2008 at 16:01 UTC | |
|
Re^2: API complexity measures
by zby (Vicar) on Jun 10, 2008 at 20:16 UTC | |
by GrandFather (Saint) on Jun 10, 2008 at 21:30 UTC | |
|
Re^2: API complexity measures
by zby (Vicar) on Jun 12, 2008 at 07:00 UTC |