Cliché, but here we are. Let’s look at it from another angle. Though “chicken or egg” is a causality dilemma as to what came first, I want to turn it into a creator’s dilemma, as to what to make first. Design or Code? As programmers we always struggle with this dilemma. The question we ask ourselves is how we can build something without its blueprint. The purist in me says Design first! The pragmatist in me, on the other hand, puts the pedal to the metal from the word go! The keen-eyed must have already seen it. Guilty as charged. We always want to do the right thing to design first and then code. But as it always happens, we code first and then circle back to documentation. It’s not by choice – it’s just the nature of the business end of things.
It is much more apparent for API design, as we don’t even think of designing the APIs first, and more often than not, we implement them first. And justifiably so. APIs and microservices, by definition, separate out the overall functionality into cohesive objects. Meaning each object specializes in one part of the functionality, because of which we can immediately see the APIs required for that function. Many a programmer have been through the Object-Oriented designing experience, and this makes “APIs plus microservices design” easy for them to visualize. When the time to market and agility are of paramount importance, we forge ahead with coding first. Secondly, implementing or stubbing out APIs gives ability for other teams who use these APIs to start their work in parallel. Of course, the downside is very apparent: it becomes costly to enhance and maintain. The constant code churn puts lot of pressure on other stakeholders like testers and technical writers. All in all, not a good approach in the long run.
What if, stay with me here, while APIs are being developed:
Everything without having to write any extra code!
Sounds amazing? Introducing apiezy, the API developer’s tool. In the words of Galadriel from the film Lord of the Rings:
Even the smallest person can change the course of the future.