Image for post
Image for post

As a UX designer and software developer, one of the best tips I learned was “If a method/function performs more than one task, split it into two separate functions”. This tip helps with easy debugging, logic decoupling, and generally easier code readability.

You may be wondering what this has to do with UX design, it’s pretty easy. If a design component performs more than one task, create two components. For example, if a button performs more than one task, or achieves more than one goal, create two buttons.

Image for post
Image for post
Swipe to delete action(Gmail App) Image from imore.com

Many apps with great UX use this principle. For instance, if you swipe on the Gmail app to delete an unread message, the swipe action only deletes the message. You can confirm this by checking the trash, the deleted message is still left unread. …


Image for post
Image for post

Design patterns have always been a fancy term thrown around by developers. However, design patterns are not useful if they are utilized without a reason or without solving a problem.

Simply put, design patterns are a tried and tested way of solving a problem without fail. The results of following a design pattern should always be the same. This is similar to a waffle recipe that says mix “1 cup of flour and 1 cup of water”. The results of this exact measurement will be the same everywhere, at least on earth.

In my opinion, the builder design pattern is designed to eliminate the clutter of using long constructors and it helps to encapsulate the business logic of the principal class.


Image for post
Image for post

A few weeks ago, I ran into an interesting piece of code. I did not understand it but I was mind blown. I have been coding for years and this ‘simple’ piece of code left me puzzled. Let’s look at this piece of code.

Creating a User via Method Chaining

Great. It’s super easy to create a user instance using this method. But how does this work? It’s simple.

Basically, the methods return this. Since each method returns this, each method can then be chained to call another method. Each time a method is called the return value is the class itself, thus the after calling the method dot notation can be applied to it effectively chaining it to another method. …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store