Skip to main content

Posts

Best practices for REST API design

Today I would like to talk about my experience in designing REST API . I've developed and consumed many APIs over the last few years. Well, during that time, I came across good and bad practices , I wasted a lot of time trying to understand badly designed APIs, I explored many different patterns and I made quite a few mistakes. All things considered, I think I learned a lot. I would now like to share with you the experience I have gained in my journey and the best practices I have discovered and adopted. But, before starting, in a nutshell, what is a REST API? What is a REST API? A REST API (also known as RESTful API) is an application programming interface (API). REST stands for representational state transfer . It means that when a RESTful API is called, the server will transfer to the client a representation of the status of the requested resource. Roy Fielding first introduced it in 2000 in his famous dissertation . Like other architectural styles, REST has its pr...

How to name things in code

I was looking for an article to recommend to my junior colleagues about naming things and I found a lot of great ones, but I couldn't decide which was the most suitable. No one contained all and only the things I consider important, so I decided to write my own.  "There are only two hard things in Computer Science: cache invalidation and naming things."   — Phil Karlton As developers, we are constantly rushing to meet deadlines, there are always a lot of features to add and bugs to fix, and our clients are impatient. In such a hurry it is easy to overlook code quality to get things done in the illusion of saving time . As a result, the code grows in a messy way, and the complexity increases. Choosing good names could help us to deal with and reduce this complexity . Have you ever thought that the names of variables, classes and functions are a major part of programs’ source code ? They serve as implicit documentation and a...