top of page

Refactoring

  • Writer: Aleksander Traks
    Aleksander Traks
  • Dec 16, 2024
  • 2 min read

While walking along the trails of Kilimanjaro, I noticed scattered bits of trash—mostly candy wrappers. Although it seemed like a minor issue, I felt compelled to act. Inspired by Ryan Holiday, a modern Stoic author, and his discussions on leaving the world a better place, I began picking them up.

It’s like that with refactoring too isn’t it. I recall the aptly named “Boy Scout Rule,” a principle: always leave the codebase better than you found it. Refactoring—removing inefficiencies and improving existing code—lies at the heart of a developer’s work.

A retrofuturistic illustration of a boy scout picking up trash on a hiking trail, with neon blue and orange hues symbolizing responsibility and continuous improvement.
When it comes to bad code we should act like boy scouts and mark it for future improvement or solve it straight away if it's a small change.

I once worked with a client whose website became unusable and unupgradable due to rushed deadlines and poor coding practices. I often wonder if an early commitment to refactoring—thoroughly cleaning up the codebase—could have prevented the problem from escalating. It reminds me of the “broken windows theory” from New York City’s metro cleanup, where maintaining cleanliness discouraged further neglect. Would refactoring have set a standard for future developers, or would bad habits have crept back in?

Refactoring isn’t just a coding practice; it applies to life as well. Whether it’s optimizing two lines of code or picking up trash on a hike, small actions can have a big impact. While they might seem insignificant at first, over time, these efforts add up to meaningful change.

A retrofuturistic illustration of a domino effect, with glowing neon blue and orange dominos falling in a cascading pattern, representing how small actions can trigger larger impacts.
Even a small change like picking up some trash or simplifying a couple of lines of code can have a great Domino effect.

Refactoring, like cleaning up, can be challenging without long-term commitment. During a brief stay in Tunis, I noticed a neighborhood that needed cleanup. I wanted to help but hesitated, knowing I’d be leaving in a few weeks. Still, even small actions can set an example and inspire lasting change. By fostering a culture of continuous improvement—whether in code or life—we create a foundation for a better future.

Refactoring is more than a technical practice—it’s a mindset. Whether we’re improving a piece of code or cleaning a hiking trail, these small acts of care contribute to a better world. By adopting a culture of continuous improvement, we create a legacy of progress for ourselves and future generations.

Aleksander Traks on Kilimanjaro, standing on a rocky trail surrounded by a stunning mountain landscape, symbolizing the journey of self-improvement and leaving the world a better place.
Picking up Trash on Kilimanjaro Inspired me to look inwardly about Refactoring en masse.


 
 
 

Comments


bottom of page