Programming, Object oriented design, design patterns

Do you Want to Borrow Time From Future

We developers do two things only. Update our existing code and add new code. These are the only tasks that move our project and not meetings, testing, code reviews and surfing on Reddit 🙂

But the challenging part for me is should I update/add code directly or make improvement in the design before anything else.

How do I know if my codebase requires improvement in design? I know that instinctively and many other developers know that too. If your instincts are not good enough then your codebase will tell you by making your life harder if you try to change/update it.

We know what hard means. It means sitting late hours, breaking other tested/working features, stress and bashing from seniors/managers/customers and etc.

Who is responsible

A bad codebase can be compiled to a functional product. I know a lot of badly structured codebases that compiled to working products and are working fine. (only for the time being–but I know one day they will break when someone is going for ‘new updates’)

Developers are lazy species. We don’t want to invest in things that don’t move the project. Often we want to get the work done now and think about the future later.

I don’t want to put all the responsibility to developers. In fact, developers are the least responsible. Most importantly it’s our eco-system that is not supportive. It’s about the manager/team lead and the customers.

Managers don’t need a good codebase they need a working product. So does our customers. This cumulative act of not doing anything leads to bad design. Which lead to the bad codebase.

Inside-Out

Today let’s not focus on the outside world. Focus on us-the developers-why good quality codebase is important to us? Should we improve code structure before adding new code? Here is how I think about it:

Once I read that coffee/caffeine stimulates some chemicals in our brain. This stimulation makes us efficient but temporarily. It’s like getting charged up. When these chemicals get depleted so does our efficiency.

But this depleted energy is not at the normal level or previous non-caffeinated performance level. You will be unable to do a simple task. So, by taking coffee we are getting efficient temporarily but at the cost of lower downtime in the future.

Similarly, we are buying time from the future when we are not doing the necessary design changes today. By not updating code structure, it will be hard to update the codebase in the future.

So it’s up to you to decide whether you want to invest in the future or borrow from the future?