Hammer is bad for your API
Today I’ve stumbled upon Mike Amundsen’s brilliant article on API Design. Right after, I’ve read Ben Helpern’s piece on why are programmers anxious about new technologies and why it is probably OK to take them with a moderation. What has got me was the psychological and social connection of the dots.
As Amundsen pointed out famous psychologist Abraham Maslow observed we use to stick with what we know:
It is tempting, if the only tool you have is a hammer, to treat everything like a nail.
At first, I was thinking this Maslow observation combined together with the lack of knowledge — or pure ignorance—leads to what Fielding was hitting with his address on the latest technologies:
Consider how often we see software projects begin with the adoption of the latest fad in architectural design, and only later discover whether or not the system requirements call for such an architecture.
However, reading Helpern article’s lead:
Any time a hot new programming language or framework or methodology pops up or gains popularity, which is pretty much every day, there is a palpable fear and paranoia I see pop up within the programming community. Many programmers are concerned about missing the wave and letting their skills grow obsolete.
It might be the reasons to Fielding’s observation are social as well. After all, nobody wants to become “a programming dinosaur” (in somebody else’s eyes).
It is clear that the improper API designs are often caused by:
- sticking to what one know
- lack of knowledge
- following the latest trends
It is up to all of us to fight those. Study your (distributed) system (needs), learn the patterns, study existing architectural styles, and then decide and educate back. It goes without saying that by “distributed system needs” I am referring to both server and client.