Keep That Brain of Yours in Shape

We work with our brains so we need to keep them in shape.

3D model of a human brain
health

Posted on Aug 5, 2025 | 13 minutes to read

We think, we discuss, we build, and we fix

Our brains control everything we do. From breathing to physical activities and conversations, our brains are at the helm. As software engineers, we spend our days thinking through problems, discussing solutions, and translating them into code. We live in our thoughts more than those in many other professions, so it’s fair to say that our brains are our most important tool.

Over the years, there have been countless articles, studies, and discussions about keeping our minds sharp. Given that our brains are the primary tool for engineering work, it’s the tool we need to keep sharpest. Unfortunately, sharpening a mind isn’t as simple as taking a knife to a whetstone and finishing with a stropping block. It’s a complex process with multiple approaches.

I’ve experimented with various methods to keep my mind sharp over the course of my career. Today, I’d like to share some of what I’ve learned. Your results may vary as this is a personal journey, but these strategies should at least be helpful for most people.

Sleep is your best friend

koala sleeping on a tree branch

* I am not a doctor and this is not medical advice. Please consult your doctor before taking any sort of supplment/medication, starting a new exercise routine, or making any changes to your sleep routine. *

Many people struggle with sleep — including me. Over the years, I’ve dealt with prolonged periods of insomnia and countless nights of poor sleep. Lack of sleep causes numerous issues, some of which can severely impact our health or even shorten our lifespans. While I won’t get into every problem caused by insufficient sleep, its significant impact on cognitive performance is one reason why software engineers need high-quality, adequate sleep.

Whether or not you nap, experts agree we need 6–9 hours of continuous sleep each night, which isn’t always easy to achieve. A common piece of advice — and one I’ve adopted — is to establish a consistent routine. Humans naturally crave routines, even if we don’t always realize it. A consistent sleep schedule significantly improves both sleep quality and duration, making the effort worthwhile. However, it varies from person to person because we all live differently and have unique preferences. My routine isn’t for everyone, but it has worked incredibly well for me:

  • no caffeine after about 5pm
  • no eating of anything after dinner which is usually between 6pm and 7pm (sometimes earlier if I’m really working on my intermittent fasting)
  • take nighttime supplements after dinner which includes magnesium glycinate and probiotics
  • no more phone time after 8pm
  • take my CBD gummy at 8:30pm
  • at 9pm, go into my room, turn on the air purifier, lay down, take a Unisom tablet, and watch an episode or 2 of a show
  • turn the white noise machine on and the lights off

There’s more to this than just sticking to a fixed sleep schedule. My phone automatically switches to night mode — a feature that shifts its screen hue to a warmer color - a little before sunset each day. However, I still avoid using my phone after 8pm due to blue light’s negative impact on sleep. Additionally, I avoid watching TV in the living room after 9pm because its color calibration is set for accuracy. Instead, my bedroom TV is set to a warmer hue, allowing me to watch more TV while lying down which signals to my body and mind that it’s time to relax and wind down.

Body chemistry is another key factor to consider, and my routine includes several steps to optimize it for sleep. I limit caffeine intake to two large morning coffees, typically before noon. If I’m out for dinner or craving tea later, I’ll occasionally have another caffeine drink, but I try to make sure my caffeine intake is finished by 5pm. I’m a strong proponent of CBD products, as well. After years of experimenting with various options, I’ve settled on specific CBD gummies that help me relax and improve sleep quality.

Years ago, I consulted my doctor about sleep aids, and he recommended Unisom. He explained that it’s non-habit-forming and essentially an older antihistamine designed which induces sleepiness as a side effect. This gives me the added benefit of allergy relief, too. I also take magnesium glycinate daily. Magnesium is crucial for our health, and this form is highly bioavailable while also improving sleep quality through its glycine component. In fact, magnesium glycinate is the most critical part of my routine, and I always have poor sleep if I skip it.

I’ve also learned that serotonin converts to melatonin, and serotonin is produced by gut bacteria. Since becoming aware of this, I take probiotics with dinner every day to increase my body’s production of serotonin. If I’ve had several bad nights in a row, I’ll occationally use a melatonin supplement to get me through the rough patch. However, I believe melatonin should only be used occasionally, as research suggests they may disrupt natural melatonin production which is why I focus on maximizing my body’s natural production. Sometimes, I still need a little extra help.

To go even further, in my bedroom, I use both an air purifier and a white noise machine. The air purifier removes dust and allergens from the air, which helps with both my allergies and sleep quality. Additionally, its white noise generation helps clear my mind. I also keep an additional white noise machine on my nightstand, which I run on just before turning off my lamp. Combining both devices has significantly improved my sleep quality.

To supplement, or not to supplement?

several supplement bottles in a cabinet

my supplement cabinet

The modern diet lacks many of the nutrients we need to function at our best, so it makes sense to take supplements to correct these deficiencies. Over the years, I’ve spent a lot of time researching supplementation—reading articles and watching videos—and trying different supplements to see if they had a positive impact on me. If our bodies have the nutrients they need, our minds work more efficiently. There are also things we can take to temporarily improve cognitive performance. Again, I’m not a doctor. This isn’t medical advice. What works for me may not work for you. Here is a list of some of the things I use to boost my cognitive performance:

  • magnesium glycinate (improves sleep)
  • probiotics (improves gut health which improves sleep)
  • creatine hydrochloride (improves cognitive performance)
  • Fish oil and turmeric (reduces inflammation which can improve cognitive performance)
  • caffeine and nicotine (improves cognitive performance)
  • ashwagandha (reduces stress which can improve cognitive performance)

I already mentioned magnesium and probiotics in the last section for the sake of improving sleep. While that is one benefit from taking these supplements, they also have other benefits. Magnesium is an essential mineral involved in over 300 enzymatic reactions in our bodies. The list of benefits is long, but regarding cognitive performance, magnesium boosts energy, improves nerve function, and aids in stress management. Probiotics improve gut health, leading to more regularity with less discomfort and more serotonin production which results in more melatonin production later in the day. They also boost the immune system, helping our bodies function optimally and reducing sick days. These two nutrients are probably the most important things we can take. That said, you need to find the right products for you and ensure they’re of high quality.

There’s been a lot of buzz lately about creatine. Weightlifters have used it for decades to aid muscle recovery and strength gains. Only recently have people discussed its positive effects on the mind. Early findings suggest creatine may improve memory, attention span, and information processing speed. The consensus is that creatine monohydrate is the best form, but if you have a sensitive stomach like me, it might cause nausea. I tried creatine hydrochloride with no negative side effects. It’s very acidic, so if you take this version, consider capsules to protect your teeth from acid exposure. As I lift weights regularly, I’ve noticed less soreness and faster recovery since starting creatine.

Nootropics are supplements claimed to improve cognitive performance. While there’s hype and questionable science around them, some legitimate benefits exist. Two well-known effective nootropics are caffeine and nicotine. Both are stimulants that boost energy levels, helping focus and efficiency. Before you light up a cigarette, don’t! I smoked for years and wouldn’t wish it on anyone — it’s harmful and addictive. Instead, I use nicotine pouches when needing a mental boost. While their long-term safety is still debated, they’re far less harmful than tobacco products, don’t create odors, and carry less social stigma.

I’ve experimented with other nootropics like Lion’s Mane and L-Tyrosine but didn’t notice significant performance benefits or downsides. Research varies widely—do your own investigation to learn more about them. There is a lot of imformation out there regarding nootropics, but I’ll leave it up to you to do your own research. Just know that there is a lot of junk science and hype out there.

Lastly, eliminating brain fog involves addressing its common causes: dehydration, poor sleep, sinus issues, and stress. For me, proper hydration is key — I drink water throughout the day with occasional electrolyte mixes for dehydration. I use daily sinus rinses and occasional Flonase sprays when needed. Quality sleep lowers cortisol levels naturally, but I also occasionally use ashwagandha to manage stress. I take it only when needed and discontinue after a short period as there are claims that prolonged usage can have some negative effects. These habits help me maintain mental clarity, which is crucial for keeping my mind sharp.

Sweat and sunlight are your best friends

gym equipment in a garage

my garage gym

Exercise is incredibly important for overall health, including brain health. Not everyone likes exercise, and almost everyone says they just don’t have time for it. I learned long ago that you have to make time for some things, and I definitely prioritize making time for exercise. This looks different for everyone as we all have varying fitness levels, preferences, and physical restrictions. For me, lifting weights about an hour a day, three times a week, is my main source of exercise. Additionally, I have an electronic drum kit that I call “my treadmill,” and I drum to metal playlists for at least an hour each week to get my heart rate up and sweat pouring. My wife likes afternoon walks, and I join her a couple of times a week. I also play golf and disc golf, swim at my uncle’s house, and do plenty of other activities that get my heart rate up and body moving. Find what you enjoy and make time for it!

Why exercise? Well, we sit all day for work. Some of us use standing desks, but even then, we’re just standing in place. Beyond the obvious health benefits, exercise reduces stress, improves sleep, lowers inflammation, and boosts energy — all of which enhance cognitive performance. Modern society has its luxuries, but one side effect is that we have to be intentional about moving our bodies. I started exercising to improve my quality of life and health, but our brains benefit too — dramatically so.

Our sun is the source of all life on Earth. Vitamin D has too many benefits to list, but even though I supplement with 20,000 IU of vitamin D3 and 200 mg of vitamin K2 daily, I still make time for direct sunlight — the best natural source of vitamin D. You can overdo it in the sun, but at least 15 minutes a day is ideal. Proper vitamin D levels reduce inflammation, boost energy, improve nutrient absorption, and enhance sleep quality — all of which support cognitive performance. Plus, sunlight exposure increases infrared light absorption which acts as an anti-inflammatory and naturally boosts melatonin production.

Why not combine exercise and sun exposure? As someone who loves optimizing time, I highly recommend this approach! My garage gym gets direct sunlight (and in Texas, that means lifting in 100+ degree heat, increasing my sweat output). Sweating is another underrated benefit as it helps detoxify the body, reduce stress, and regulate body temperature, all of which are great for our brains. Regular toxin removal improves how we feel and think while also boosting energy and sleep quality.

To take it further: combine sunlight, exercise, and sweating with mindless physical labor (e.g., mowing the yard). This approach is physically beneficial and reduces stress levels. The best workout is always the one you’ll stick to long-term so find what works best for you!

Exercise your brain, but make sure it also gets enough rest

Rubix cube with 'figure it out' written on it

“Use it or lose it!” This applies to so many things in life, and our brains are no exception. Sure, we use our brains all day every day and sometimes kick them into overdrive to solve a problem in our code, but there’s always room for improvement.

Activities like puzzles, learning new languages, or reading benefit our minds and keep them sharp. You might be thinking, “When the hell am I supposed to find time for these activities?” As with everything else, you can make time. I don’t “kill time” on social media or YouTube. While I mentioned earlier that I watch 1-2 hours of TV after dinner, most free time goes to activities like coding side projects, reading articles, modifying electronics, completing crossword puzzles, or designing 3D models. All of these require serious brainpower meaning they positively impact cognitive performance.

But brains need rest too! Sleep is the obvious choice (and something I’ve mentioned a million times), but other methods help as well. My evening TV time gives my brain a break, and meditation/deep breathing exercises can also clear your mind. Whatever you do, give your brain time to rest before bed. It’ll improve sleep quality and leave you feeling refreshed in the morning.

To stay on top of your game, you have be intentional with your routines

None of these things are simple to implement in your life, but they’re all beneficial in multiple ways. As engineers, our brains are our most important tool. Like any other tool, we must care for them to stay sharp and perform at our best. Experimentation is key to finding what works for you, but when you find something that works, ake it part of your daily routine!