DEV Community

Lindsay Iveson
Lindsay Iveson

Posted on

Letting My Mind Rest: How Coding Gets Me Through Those Rough Days

There's a stigma around mental health. Those who suffer from it, and the topic as a whole, are not treated with the care and empathy that's deserved.

This is why I'm here - to be open and honest about my story, help someone feel less alone, and demonstrate how coding can get me through my roughest days.

Ready for me to get candid?

I was diagnosed with bipolar disorder and anxiety a few years back, and it was such a relief. I finally understood why I was so angry or felt on top of the world one week, to then crash so hard I couldn't even get out of bed. It explained why there was this constant weight in the pit of my stomach and always having my heart in my throat.

TMI? Probably. Important to share? Absolutely.

Since then, I've settled quite a bit, and have learned techniques to managing my emotions if it all gets to be too much. Sometimes it's meditating, taking a nap, or eating a PB & J; but since beginning my coding journey, I've realized that coding has also become part of my technique repo.

When I'm manic, I feel on top of the world, my head buzzing. Constant ideas bouncing around, never landing on one thing, because I can do it all. (Spoiler: It's exhausting!) But that's where beautiful, synchronous JavaScript comes into play. I can't just throw around functions or make random variables; I have to stop and think about what I need to accomplish.

doingGreat()

var arr = ["foo", "bar", "baz"];
var random = arr[Math.floor(Math.random() * arr.length)];

function doingGreat() {
  console.log(random);
}

doingGreat();

notSoMuch()

notSoMuch();

function notSoMuch() {
  console.log(random);
};

var arr = ["foo", "bar", "baz"];
var random = arr[Math.floor(Math.random() * arr.length)];

My beginning looks like this:

  1. Start to code
  2. Mind jumps a few steps ahead
  3. Write my thought down
  4. Repeat

But having to think step by step is so calming. It turns my notSoMuch() into a doingGreat(). Even if my mind whirls begins again after I'm finished, I'm grateful JavaScript can give my mind a rest for that moment in time.

(Now, that I think about it, I'm quite productive -- but I digress!)

If anyone out there is struggling with the same, I hope you get the chance to try it out; maybe you'll add this to your technique repo as well!

(Also, remember to always be kind to yourself during these times -- you'll get through it!)

Top comments (2)

Collapse
 
pclundaahl profile image
Patrick Charles-Lundaahl

I think that's wonderful! And thank you for sharing about your mental health struggles - I think they're far more common than people think.

I definitely use programming as a way to distract myself when I'm having a particularly rough day. I find when my energy is low, I have a really hard time with how unquatifiable the rest life is. Programming gives me a framework and a way to escape and relax, even if it's a tough problem and I don't solve whatever I'm working on.

Collapse
 
savagepixie profile image
SavagePixie

That's very honest and very beautiful. Thanks for sharing with us this part of your life and how coding helps you get through your ups and downs.