Productive Laziness
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!