Decluttering Our Code – Lessons from Minimalism

At the end of 2019, I started following a YouTube channel of a woman who hiked the Pacific Crest Trail, Mary Mansfield. After 6 months of simple living on the trail, she returned home to the UK and did the “Minimalist Challenge” during the month of December. In this challenge, you progressively declutter more items each day (1 item on the first day, 2 on the second, all the way to 30 or 31 items on the last day of the month). Mary shared her experience decluttering 465 items in 30 days. Inspired by her, I decided to attempt the Minimalist Challenge for the month of January, not yet aware of the journey it would take me on.

You see, I have been trying to declutter for awhile. I have a dream of living in a tiny house on wheels, and to achieve that, I need to not be weighed down by stuff. I had, of course, read The Life-Changing Magic of Tidying Up a few years before and tried Marie Kondo’s approach. I made some progress but failed to make large strides in decluttering. I thought having a measurable decluttering goal with the Minimalist Challenge might help me make progress. Inspired by Mary’s video on December 31, I was excited to begin my pursuit in the new year!

I enthusiastically and successfully completed the Minimalist Challenge on January 31st and then continued into the first part of February, adding an item to the previous days’ count each time! I was happy to be able to donate my items to a charity with hope that they would find a second life in a new home. My Minimalist Challenge, however, was not without struggles. The area where I struggled most was with sentimental items (items that remind us of a person or our past). This struggle caused me to look outward to try to find perspectives that might help me overcome the barrier to letting go of some of these items.

I started reading articles and books on the topic and learned to think differently along the way. To name a few, these are some books I found helpful: Year of No Clutter, Everything That Remains, The More of Less, and Decluttering at the Speed of Life. From these books, I gathered ideas that helped me declutter. I adopted them in my thinking about decluttering, and they served me well. And then I started noticing that I was also applying these ideas to other parts of my life, including my work as a software developer. Let me share some specifics with you!

Just in Case Items
One type of clutter that people struggle with is “just in case” items. These are items that are not currently in use, but that are kept just in case they might be needed in the future. This made me think about how we sometimes “future-proof” our code. Sometimes we add complexity to our code in an attempt to accommodate future use cases that we are not yet aware of. This complexity hangs around, cluttering the code, and may never have a real use case. It may even become deprecated or obsolete before that future use case ever comes!

Recently, I was writing a lambda function. I had a vision of a general way it could be written so that multiple brands across Enova could make use of it. The problem, though, was that we did not know if other brands would really want to use it or what features they might like it to have. Although it was disappointing to not achieve this multi-brand use case, I decided it would be better to write the code to solve the problem we have now. I added some flexibility so it could more easily accommodate adaptations, but my decluttering experience made me realize that writing extensive amounts of generic code now for a “just in case” future need would make the code harder to maintain and adapt.

Decluttering made me consciously aware that “just in case” items or code don’t really make us more prepared for the future. They only give us an illusion of control over a future that we cannot predict.

Multi-Purpose Items
Minimalists also talk about multi-purpose items. If you have one item that can perform the tasks of multiple specialized tools, it can be better to keep the multi-purpose tool and let go of the rest of the items. You may have a specialized kitchen tool like, say, a potato masher, but for most use cases, you could probably also achieve a very similar outcome by using a fork. Using multi-purpose tools reduces the amount of stuff we have to manage and can make us more agile.

A few months ago, I was writing some code where I was faced with a choice. On the one hand, I could introduce a new Ruby gem into the codebase for the narrow use case I was addressing, or I could write a few more lines of Ruby to accomplish the same thing. I chose to write the extra lines of code instead of using the gem because I did not want to add “gem-clutter” to the application. Just like our stuff, we have to manage Ruby gems when we do upgrades (think cleaning or moving house). This makes it more time consuming to do Ruby or Rails upgrades and overall makes us less agile.

My journey with minimalist thinking helped me see that I could use a multi-purpose tool, Ruby, rather than weighing down the codebase with gem-clutter! And just in case you are wondering — I did part ways with my potato masher. On the few occasions where I have mashed potatoes, a fork has worked just fine!

The Tidiness Habit
Before I started on my decluttering and minimalism journey, I was not a tidy person (my teammates might say that is an understatement). From decluttering and simplifying, I learned that having fewer items makes tidying much easier. But you still do have to take a moment to return items back to their homes to keep your space clean and tidy. Now I really enjoy having a clutter-free space. The tidiness facilitates mental clarity. My minimalism journey has made me more conscious of the importance of taking a few extra minutes to tidy something up now, rather than creating a large mess that has to be dealt with later.

When I finish writing code and create a pull request, I think about the value of the tidiness habit. I squash my commits and write a short summary of my changes so that a future developer has a concise source of information about my changes. I also look over my code and try to read it from the perspective of someone who did not write it. If it seems messy or could be confusing to a reader, I do the extra work required to tidy my pull request. I have much greater awareness that taking a little extra time now will help me and my team be more efficient in the future. You might say that keeping applications tidy is kind of like future-proofing — but without the clutter.

Prioritization and Value
“When everything is important, nothing is important.” This is a phrase that comes up a lot in decluttering, particularly with respect to sentimental items. (I do seem to have a really hard time with these…) Let’s say you have 10 boxes of sentimental items that are so important to you that you cannot bear to part with any of them. But if you are honest with yourself, you would realize that each item does not hold the same importance to you. Every item cannot be the most important. It is far better to do the hard work to determine which items are really most important and demonstrate their importance by taking them out of the boxes to fulfill the purpose of honoring the memory they represent. In writing software or in managing projects, we don’t literally have boxes full of important features, but the lesson still applies. It’s worth it to put in the hard work required to determine which features or processes are most important and will be most valuable.

I also think about this in the context of monitors and alerts we incorporate into our code as software engineers. When we add a new feature to code, we are often excited to create dashboards and new alerts to monitor this new and latest and most important feature! But if we monitor and alert for everything in our code, we will soon find that none of those alerts really stand out as the most important ones. The signal becomes lost in the noise of errors or alerts, and we begin to become blind to what those alerts represent. When every error is the most important error, we become overwhelmed by them or desensitized to them and find that none of them really fulfill their purpose anymore — to tell us when something important goes wrong.

Concluding Thoughts
As I have learned about minimalism and worked to declutter my belongings, I have noticed a shift in my mindset. I am more intentional with decisions about what to spend my time on. I think more carefully before acquiring new items. I also think more creatively about how I can use items or skills I have to address a need.

Minimalism makes us more agile. Agility is not just speed in achieving a goal but is also your ability to pivot and embrace unexpected change. When you’re not burdened by clutter, pivoting is much easier. The lessons I have been learning in my journey to minimalism have helped me not only with decisions about material things but have provided me a lot of value in my daily engineering work.

I am not done minimizing. In fact, I am currently struggling with some sentimental items. I have been searching for the right words or the right thought process that will help me overcome my barriers to letting go of the items. But that’s okay; simplifying is a journey — a journey on which we can declutter our things, our minds, our lives, and apparently also our code!