Thinking language independent through APIs
posted by christoph.kappestein on 2017-12-13
Recently I have read a post from a user who has tried to move from PHP to go. To summarize the post, the user moved back to PHP because he claimed that the go language is not great to write larger applications. Later on another user posted a counter post to argue why those thoughts are wrong. Those posts got popular on hackernews and reddit which produced many comments where users argued about the better language.
As an API developer I dont want to argue which is the better language instead let me explain a different view. At first I think people overvalue the choice of a programming language. For me the most important part is to define a clear request and response schema for every endpoint. The schema is the contract between your data and the user. How you produce this data is actually secondary. If you think this way you can easily start to write an API with PHP (faster development) and if required you can simply exchange the implementation with a go version (faster execution). Through this view you can appreciate both posts and take the best out of two worlds.
So my advice to all API developers, dont worry too much about the programming language choice. We are in a great times where the API economy rises and it becomes very easy to build an API. Instead take more time to define a clear schema for every endpoint. Also most API tools are already fast enough for normal usages, i.e. Fusio can handle roughly 350 requests/s (which of course depends on the performance of the server). If you need to scale above this you can either scale your hardware or exchange the implementation and in this case you have probably also the resources to do so.