How To Avoid Future Pain When Programming

Are you creating a mental burden for your future self?

It's no secret that poorly implemented software can make your life a living hell.

Whether you are working on a feature, prototype, or full-on product, there is always a push at some point to get what you are working on out of the door. Rushing to ship and not thinking long term can create a lot of future pain. Luckily, you can do things to protect yourself from this self-inflicted misery.

Let's talk about strategies you can use to make your software friendly to your future self.

Learn how to name your variables, functions, and classes appropriately.

I subscribe to the camp that says good code should read like prose. Learning to name things while writing fluently can be challenging and take time. The fastest way to level up your naming skills is to:

  • Read a lot of repositories and take notes of how others name and implement things in the codebase.
  • Build your vocabulary by reading more technical and non-technical books.
  • Start a writing habit to develop your style.
  • Revisit old code and analyze what you like and don't like. Correctly naming things is necessary but not the only thing required to write maintainable code.

Become sensitive to how you implement a feature.

Before you reach for a design pattern or abstraction, ask yourself these questions:

  • Why do I want to use this pattern or design?
  • What benefits will I gain?
  • What level of mental debt does this add to the code base?
  • Will I remember how this works two months from now? If you don't see the benefit after asking yourself these questions, you can probably leave out the design.

Use a damn framework!

I am against the no framework movement.

Using a tool designed to help you build and ship your product is far too beneficial not to use. It is a waste of time to glue together your framework when one already exists and has been battle-tested. I am more interested in shipping features, products, and projects than spending gluing together a framework I think is cool.

If you want to ensure your project gets finished on time, use a framework.

Your future self will thank you for taking the time to think through the possible issues an implementation might have down the road.