~ RICH CODES

Productive Laziness

February 24, 2021 | 3 minute read | āœšŸ¼ Fix typo

You're tired. Exhausted. Your mind simply isn't responding. You stare at the code; it stares back at you. You type something. It doesn't work. You delete it. The clock says: 04:00 PM.
You know what you need: a break.

Working when weā€™re tired is really dangerous (to us and our applications). We write buggy code, make silly mistakes, they frustrate us, and, finally, we burn out. Everyone has been there. So, what to do rather than keep hammering your head on the keyboard?

In fact, you got a lot of options:

  • Lie down (or get up if youā€™ve been sitting for a long time);
  • Change the room youā€™re working on;
  • Take a (short) nap;
  • Go on a walk (to your backyard šŸ˜¢) and look at the sky;
  • Play a song on your guitar;
  • Play with your pet;
  • Tell your loved ones you love them;
  • At least go drink some water! You get hydrated and it may boost your productivity!

The important part is to get some distance from the problem youā€™re facing. Context switch is really important. You may think that breaks will kill your flow, and itā€™s easy to convince yourself that you donā€™t have time for them, but hear me out: they work! Well, you donā€™t have to trust me, science has shown this over and over again.

I canā€™t take a nap! Iā€™m working!

I realize not everyone has the freedom/opportunity to do those things. Or you may not be comfortable doing them during work time, and I get it. So, Iā€™ll list some alternative tasks you can do instead. I call them productive laziness because even though theyā€™re not your primary task, theyā€™re still useful (for you and your app)!

Productive laziness tasks

Review Pull Requests from libraries you like

You donā€™t need to be a maintainer to do this! OSS folks have lots of work to do, so go ahead and give them some help (and maybe you do end up as a maintainer). You donā€™t need to be an expert in the project. Just knowing the programming language behind it can help you! You can suggest better variable/method names or methods with better performance, for instance. But please, be kind.

Open Pull Requests for libraries you like

If youā€™re feeling brave, you can help OSS ever further! Fix some bug reported into their issue tracker. Maybe a refactor or performance improvement? Search for issues with tags like good-first-issue, easy, beginner or first-time-contributor. Thatā€™s how I got my first contribution merged into Rails!

Read docs from languages/libraries you use

This is quite obvious, but learning that one method can save your life later! You may found a new helper method that makes your code simpler or faster.

Read a blog post

This is basically the same as the previous one, but it doesnā€™t have to be technical. You can learn some productivity technique, read something inspiring or just laugh out loud. Iā€™m pretty sure you have some marked as ā€œread laterā€ somewhere.

Write a blog post

Iā€™m pretty sure you have something to tell. Donā€™t worry, you donā€™t have to finish it right away. Just put some basic ideas in the paper. Youā€™ll perfect it later.

Learn some keybindings on your text editor

Consider this an investment: a couple of minutes today saves you a life of keystrokes! You can learn some terminal tricks too! It is the same idea.

Reply that one email youā€™ve been postponing

Itā€™ll only take you 5 minutes. Get rid of it accumulating dust in your mailbox and in your brain.

Pay off some technical debt

This is by far my favorite alternative task. Here you can do what you like the most:

  • Fix N+1 queries;
  • Add tests to improve your test coverage;
  • Improve the loading time for some page in your web app (using lighthouse and other dev tools);
  • Fix that one exception that your monitoring tool reported. This might be a good opportunity to start TDDing. Hereā€™s how.
  • Solve some simple CSS problem: alignments or spacing issues, for example;
  • Refactor some nasty code you find. You can do simple things like renaming variables/methods or extracting functions/classes.

Remember:

ā€œA refactor a day keeps the rewrite away!ā€ - Developer Granny

You may not fix that nasty bug by the end of the day, but a least your app will be faster/cleaner/have more tests! I think thatā€™s a nice trade-off.

Itā€™s all about incentives!

These short tasks give us small wins, and they motivates us to keep working on annoying chores.

Hereā€™s something to keep an eye on: be sure to make the laziness time-boxed! You donā€™t want to spend the whole day in a alternative task šŸ˜œ.

Finally, no matter how your day goes, be kind to yourself. Some days are amazing, some days are terrible, but most days are just doing the work of life. Do your best to enjoy them!

Categories

productivity