Uh oh! Looks like JavaScript is disabled.

Bitman requires JavaScript to fuel his thirst to end bad UX and lazy design, which is necessary to give you the best viewing experience possible. Please enable it to continue to our website.

/consulting - 3 min read

Wait! Don't write code yet

Vidhya Desikan

Vidhya Desikan

Developer

A isometric image of a 3D maze

As developers, it is necessary to understand how the code we write helps solve real-world problems. Often, it is easier to think about users while writing the application layer of code. But as we move deeper into the tech architecture, it is not as easy to do. Today I would like to demonstrate the benefits of an exercise that relates what seems a pure tech world scenario to the real world.

Let’s focus on the scenario where we call a 3rd party API as part of our workflow. One possible real-world scenario that we can associate it with would be trying to return a book that we had borrowed from a library. This is how we can probably try to associate the actions that we follow in the tech world as compared to the real world.

And so on, to accommodate other possible scenarios. It is easier to figure out all possibilities of both success and failure in a real-world scenario rather than thinking about it as just APIs and response codes. This helps us in:

  • Realizing that there is more to the simple tech task than what is visible initially — helps get an overall picture.
  • Determining which of the possibilities we have to handle and which ones we want to ignore, specific to the use case that we are developing.
  • Choosing between the different libraries that we can use to make the API call. Or decide to work on creating our own library for it?
  • Thinking about failure scenarios in advance helps develop robust code. It helps us think about the various states that the end user can stay in and leads to discussions on the UI/UX of the application. (As a side effect, this improves collaboration within teams)
  • Determining what we need to monitor and what scenarios call for raising alerts.

It is possible to come up with various real-world analogies for the same scenario depending on what we encounter in our day-to-day life. Billing counters are another analogy for the same API call scenario. This will probably lead us to think about queuing the requests. So multiple analogies make this exercise even more effective and with repeated practice, it is easy to figure out the most effective analogy.

The main aim of a project should be to find a solution/method to help improve the day-to-day activities of a particular set of users. Once this frame of mind is established while writing code, it is easier to understand how the code we write relates to the real world. This helps us massively in designing our code better and distinguishing between the must-haves and nice-to-haves.


Hey there, I’m Vidhya. I believe that good coding practices outlast trends. I have seven years of coding experience. My idea of a relaxing time is to pair code with fellow devs. When I’m not coding, I learn to parent my two children.


Vidhya Desikan

Vidhya Desikan

Developer


Let’s build digital solutions together.
Get in touch
->
Lenny Face