Home

3 minute read

Clean Up Your Legacy Code

Tony Lea

Clean Up Your Legacy Code

The code you write today will eventually become "legacy code". After time our code needs to be refactored or rewritten. Similarly the thoughts and impressions we code into our mind must also be refactored or rewritten. In fact, a lot of life's problems can be resolved by rewriting the code in your mind.

Why Should You Refactor the Code in Your Mind

There are 2 major parts of our mind. The conscious and the subconscious. Similarly as developers our applications also have 2 major parts, the logic and the data. In this example, you can think of your conscious mind as being the application logic and your subconscious mind as being the database.

Within our applications we use logic to tap into our database, and similarly, within our lives we use our conscious mind to tap into our subconscious. Now, as we get older our application logic gets more complex, yet we still use the same functions for retrieving and sending data to our database (subconscious). And, here's the problem with that...

What if the logic in your mind is fetching incorrect data. Perhaps you have a childhood memory that prevents you from becoming a public speaker or you have a fear of failing every time you try something new. Even if your conscious mind knows you need a change, it will never happen unless you learn how to rewire or rewrite the functions that tap into your subconscious.

This is why you need to clean your legacy code. You need to write new functions and create new behaviors that modify your data and reprogram the inner workings of your mind.

How to Refactor the Code in Your Mind

The way our conscious and subconscious receive information are very different. The conscious mind acts as a gate keeper and filters what information should be sent to the subconscious. Luckily, I have 2 cheesy analogies to help you visualize the relationship between your conscious and subconscious (the logic and the database).

The first analogy: The Mailman and The Dog

The mailman's job is to get your mail through your gate and to your front-door without being run off by the watch dog. The dog (your conscious mind) is very cautious about the mail or information it let’s enter the front door (your subconscious). Sometimes the information is easily passed from the conscious to the subconscious, but other times the mailman has to put up a fight in order to get the mail to your front door.

The conscious is the gatekeeper of information and if it has incorrect filters then incorrect data is being passed to your subconscious. Let me give you an example of a filter. 

If you think that making a million dollars a year could never happen (a filter in your conscious mind). Then the vicious dog of your mind has already chased off the mailman carrying that million dollar letter. Now, anytime the thought of making a lot of money enters your mind it is easily chased off and never enters the subconscious as a possibility. This is why people say that becoming wealthy is a state of mind.

The reality we live is limited to the beliefs we allow our subconscious mind to perceive as true. So believe in yourself and be optimistic and your reality will soon change for the better.

Now it may seem like I’m picking on the conscious mind, but it’s important to realize that the subconscious mind would be nothing without our conscious, bringing us to the second analogy.

The second analogy: The Captain and The Engine Workers

The conscious mind is kind of like our Captain, he is our navigator who guides and directs the ship, and our engine workers are responsible for powering the ship. It's important to understand that one would be nothing without the other. The captain relies on the engine workers to power the ship, and the engine workers rely on the captain to navigate the open sea.

Our subconscious mind is what powers our beliefs, perceptions, and reality. If we have a bad captain aboard we will soon be shipwrecked and stranded on a deserted island of our minds. This is why we need to make sure our captain is at the top of his game. 


In order to reprogram your legacy code you must rewrite negative functions that are sending incorrect data to your subconscious. If you reprogram your conscious and clean up our legacy code, you are more likely to allow good and positive logic into your database. This will have a ripple effect on your life. Be optimistic and seek out positivity and it will return back to you ten-fold!

You have a built-in machine learning system that will exponentially continue to get better if you shift your thoughts, seek out behaviors that are beneficial, modify your filters, and clean up your legacy code.