DEV Community

Cover image for Want To Write The Best Code You Possibly Can? Read this
Dmitry Shvetsov
Dmitry Shvetsov

Posted on • Updated on • Originally published at iamdi.dev

Want To Write The Best Code You Possibly Can? Read this

Photo by Daniel Jensen on Unsplash

Have you ever worked extra hours late at night on an important overdue task and had no luck in finishing it, but the next morning you solved it in 15 minutes? Here’s why.

We have limited brain fuel—mental energy to make well-thought-out decisions. As long as we have it, we are able to make good decisions. But when we are low on it, we can have problems deciding even small things, like where we want to have a Friday night dinner with friends, even if we only have two options at hand.

Studies show that people make more mistakes and doubtful decisions when they are depleted and feeling decision fatigue (the scientific term for when you have low brain fuel).

Since making logical decisions and solving problems are activities that require a lot of brain fuel, anything that drains it over the course of a day can have a huge impact on our performance. It can influence the quality of code we write, the number of bugs we introduce, and the time we need to solve a problem.

All The Trivial Decisions Than You Have To Make

Trivial decisions are one of those things that drain our brain fuel.

Decisions like what to have for lunch shouldn't take too much energy. But the problem is that during any given day, we have face so many decisions like this that can devastate us significantly.

The good news is that we have total control over it.

Let's see what choices we might have during a usual day:

  • What to wear today—from socks and shoes to shirts and hats. (These are all separate decisions, and ladies can lose a good portion of brain fuel here.)
  • What to eat for breakfast, lunch, and dinner (as many as three decisions)
  • When to leave the apartment to commute to work
  • What route to take to work
  • Where to park your car today
  • What time should I review code—now or later? Should I read this email now or later?
  • When is the best time to have a chat about with my teammates?
  • Do I have time to read an article today?
  • Should I skip gym today?

You got it. The number of small decisions we make each day far outnumber the larger and more important ones.

What are your small brain drainer things? Leave a comment.

By removing those decisions from your day, you free up brain fuel for more things that we developers like most: producing elegant code, solving problems, and saving the day.

Gradually automate, eliminate, and batch trivial decisions. Make your day structured and planned in advance.

Here’s what you can do with each trivial energy drainer:

  • What to wear → be like Zuckerberg and have a same clothes for every work day, OR prepare a stack of clothes for the whole week, thus turning five decisions into one.
  • What to eat for breakfast, lunch, and dinner → Pick a single place and decide what to eat there for a week, then change the place the next week (this is what I like to do), OR have an order of places to rotate through, OR delegate this decision by letting someone or something (a program) pick for you.
  • When to leave the apartment and what route to take to work → Pick the best route and time that works for you and stick to it. This will also help you wake up at the same time every day, which is a huge win.
  • Where to park your car today → Choose one spot. Pay for a parking space if needed, or find an always-free space on the nearby street. Don’t be afraid of a 5- to 15-minute walk—it has good side effects on your health and thinking.
  • Reviewing code now or later → Pick a time when you do it daily and stick to it.
  • Should I read this email now or later? → Do it once a day at a time you designate, and disable email notifications. This should work even if you are in a leading role.
  • When is the best time to have a chat about [topic] with my teammates? → * Schedule time daily or weekly for this. Have a list things to discuss—don’t trust your memory because this is also taxing to your brain.
  • Do I have time to read an article today? → The same answer—schedule it. * Do it daily or each weekend. Use mix.com, pocket.com, or Safari’s Reading List to stack articles for a dedicated reading time.
  • Should I skip gym today? → No, you shouldn’t. :)

Repeat and Improve

“I'm not going to live by their rules anymore.”

– Phil Connors, Groundhog Day

Have you seen the Groundhog Day movie? The main character, played by Bill Murray, had an amazing opportunity to master his day, although he did not recognize that brilliant opportunity right away. The character improved his life and himself by trying different activities and doing over and over the things that worked.

Apply the same approach. Try new things and see the results. Remove old ones and see the results. When you do the “same day” over and over again, you can analyze different things and see what works well and what drains you.

After 2-3 months, you will find everything that works and eliminate everything that doesn’t. But don’t settle for what you have—continue to experiment to see if you can make it even better.

I have a lot of fun doing experiments. It is like being a mad (computer) scientist and doing experiments on yourself.

Conclusion

The more decisions you need to make, the worse you’re going to be at making well-thought-out decisions.

It’s really just a numbers game—only essential decisions should remain. Tools to implement this include elimination, automation, and batching.

  1. Eliminate or automate trivial decisions that have a low impact on your life and work.
  2. Enter into low fuel consumption mode (Groundhog Day) and make a brain fuel reserve for working on what you love: writing awesome code, solving problems, closing tickets, and making your colleagues happy.
  3. Master your day with trials and experiments and see what works for you and what doesn’t.

Ready to Upgrade Your Productivity to the Next Level?

I've created a productivity framework for eliminating unproductive activities, reducing decision fatigue, and planning weeks for effortless execution.

Get the Productivity Framework here!

Top comments (0)