System Init
0%
LOADING_ASSETSv2.0.26
blogs/debugging-hubungan-sosial--menghapus-dead-code
//Khay
Baca Bahasa Indonesia

Debugging Social Relationships: Removing Dead Code

LifeRefactoringPhilosophy

Yesterday I saw my friend crying in the corner of the campus because she was fighting with her circle of friends who are clearly toxic. She felt bad about leaving them because of the classic reason: they have been friends since freshmen orientation.

I just listened to her story until she was done, then I asked her, do you know the difference between your social relationships and an app that crashes frequently? The answer: an app that crashes usually piles up too much unused memory.

This is what in the programming world is referred to as dead code or memory leak. Code that actually has no function anymore, but you keep it because you are too lazy to delete it. You are afraid it will break other functions, or you feel bad because it was hard to write. It is exactly like you keeping toxic friends just because you share memories from orientation days. Even though those friends only drain your energy every day without ever returning any positive value.

In computer science, we have a mechanism called Garbage Collection (GC). Its job is simple: find objects in memory that are no longer referenced by the main program, and delete them so the memory space can be used for other more important processes.

Unfortunately, the human brain does not have automatic GC. We have to run this deletion script manually. And this is what makes a lot of people stressed. They feel that cutting people off is evil. But if you think about it using system logic, cutting off people who are no longer aligned with your vision is not evil. That is called optimization.

How do you know which friends fall into the dead code category?

It is very simple. Try tracing all your interactions with them over the past month. How many times did they support you when you were down? How many times did they only show up when they needed to borrow money or piggyback on your assignment? If the input-output ratio is extremely unbalanced, and their presence actually increases your emotional CPU usage, congratulations, they are dead code.

So how do you delete them without drama?

Easy. Do not just delete their database right away (aka blocking all their social media while being angry). That is too aggressive and could actually cause a new error in your social system.

Just use the deprecation method. Slowly give them warnings that you are busy. Reduce the frequency of replying to chats from real-time to requiring a latency of a few hours. If they ask you to hang out, give them an excuse that you are focusing on a project. Eventually, a connection timeout will happen naturally. They will look for another server willing to accept their requests, and you can use your memory for other more useful things, like taking a nap or learning machine learning.

So stop feeling guilty because you left a toxic friend. You deserve to have a clean architecture environment. Friendship should be like dependency injection, you choose yourself which modules you want to include in your life so your system runs smoothly.

Do not let your life crash just because you are too lazy to delete one line of junk code.