Script the Recurring Tasks

I argue that you should spend more time writing scripts to 🤖 automate away recurring tasks. Doing so will probably prove even more valuable than you would expect.

🔁 The Recurring Ceremony

Have you ever found yourself repeating the same manual task over and over again at work?

I know I sure have. Here are a few examples:

It's easy to get used to doing such things manually, over and over again.

Common ⌨️ keyboard sequences and 🖱️ mouse clicks eventually get trained into muscle memory. These memorized sequences can oddly enough feel somewhat satisfying, like a recurring ceremony. There might be a certain comfort in doing the same thing over and over again. The tediousness from repeating the same thing can falsely make you feel productive.

All of the examples above can be scripted away to a large degree. You could for example use GPT to write your commit messages and add shortcuts to position your windows.

⏱️ Is It Worth the Time?

xkcd 1205: is it worth the time?

Perhaps you have seen The site explains it in depth if you want to dig deeper.

So for example I used to spend 1h every Monday preparing the releases for my team. Creating a script to automate that work took about 1 full working day. According to the chart above spending 10 days would have meant I'd break even in 5 years. I'd break even in half a year? A good investment then!

💡 But I argue that this xkcd is a bit simplistic. It may encourage a pessimistic view of automation. I think you'll break even much sooner (after the initial learning curve) and that there are multiple extra things to consider to scripting things away as well!

📈 Learning how to automate

When starting your automation journey it might feel like automation takes way too long to be worth it ⏳. That's probably true!

Chances are you aren't that good at it yet. Writing automation scripts is a skill in itself. Luckily you will get better at it if you keep doing it 👨‍🎓.

Remember when you initially started developing software? Everything took ages. You had to Google everything. Learning how to automate is a bit like starting over again. You may have to learn a new language, like bash, and that takes a while.

This means you must initially automate things, just because, without breaking even (according to xkcd 1205). Just to learn.

Don't let "the plateau of latent potential" in the "valley of disappointment" discourage you:

The Plateau of Latent Potential

Just keep automating things. Ideally make automation a habit. Perhaps something you do for 1h every morning? The book Atomic Habits is a great read on this subject.

🧠 A Second Brain

Store all your scripts in a git repo! Over time you will build a personal productivity 🧰 toolbox of yours. This will offer benefits similar to a "second brain".

Have heard of Zettelkasten? It is a note-taking system that:

  1. Helps you not have to remember everything yourself.
  2. Link related pieces of information to each other.

☝️ Your toolbox of scripts will provide two really similar advantages:

  1. Once you have scripted things you can forget the details.
  2. You can break out reusable functions.

It's said that Zettelkasten offers a sort of exponential effect. Once you have a certain amount of notes the linking possibilities in your Zettelkasten network explode.

I have never tried Zettelkasten, but I can verify this happens with a script toolbox. Automation takes less and less time since you can re-use existing functions you have already made.

🤖 Consistency and Quality

Scripting away tasks is not just a time saver. It can increase order, consistency, and quality.

Say you automate the writing of release notes and make a bot post them in a Slack channel. The release notes will have the same structure and formatting every week ✨📝. Your colleagues can now get used to this consistent format. You can also invest in formatting text bold and use bullet point lists that you would have been too lazy to do if it was a manual repeating chore. This increases quality.

You also increase quality by reducing the risk of human error 🚫🙅‍♂️. Your script will not make typos and copy-paste the wrong Jira ticket. Your script will not forget to automatically move the ticket to the "review" column on your Kanban board when it automatically opens a pull request for you.

So automation makes you a more orderly person. You will be able to do things the same way, with consistently high quality, without forgetting things.

📅 Kids and Career

Junior developers have a lot of time to write software. Tons of focus time to just code.

As you grow older and more experienced you might find that other activities start eating up that sweet zen flow focus time of yours.

Senior developers often have to host planning meetings, participate "syncs", and make inspiring slideshows to sell technical ideas at the monthly engineering forum. While hopefully all of that is fun you may find that you only have half the time to write code that you used to because of all the meetings.

Two hours of manual recurring tasks were just 1/4 of your working day back when you were a junior. Those same two hours would now eat up 1/2 of your day when you are senior and half the day in meetings.

Then you have a 👶 child or two. Goodbye peaceful sleep and waking well rested every morning 😫.

Your prior investment in automation may very well be what saves you.

🧑‍🤝‍🧑 You are not alone

Personal productivity matters, but the overall productivity of the team matters the most. Interestingly automation can help you avoid being a 🐌 bottleneck.

The theory of constraints says there's usually a single bottleneck that slows down the entire team and limit overall productivity.

🤡 As a poor example perhaps the FE developers spend most of their time 😴 blocked waiting for BE endpoints? While that could probably be solved by mob programming and better sprint planning we'll proceed using that example.

Automation can help you deliver fast when it matters the most. Your automation will allow you to deliver those backend endpoints 🚀 quickly and unblock the frontend developers. Then you are no longer blocking anyone, and can 🏦 invest some time into your automation toolbox without slowing down the team.

What I'm trying to highlight here is that the need for you to fully focus on the development of new features is not constant. Sometimes you will be blocked, awaiting other team members. That's when you invest into automation. Then it's your turn to deliver and work 🏃 quickly. That's when the investment into automation pays off - because you are fast when it matters the most.

🧳 Switching Jobs

🤫 We shouldn't speak loudly about this one... 😅 but you will not stay at your current employer forever. I've heard it's pretty common for developers to switch jobs every 2-4 years.

Switching jobs serves as a reset button for the time spent on automation. As you start your new job it's like you spent no time automating at all. Yet you have that second 🧠 brain of yours; your personal productivity 🛠️ toolbox.

So long as you automate things common for most tech jobs, such as git commands and Jira, your toolbox will serve you right away. You hit the ground running with some rad automation already in place.

Don't get me wrong. I believe in doing your very best. I believe in working hard for your employer. But we can not only work hard. That does not scale forever. We must also work smart. And that means continuously investing in ourselves, learning new things, aaaaaaand building rad scripts to automate away the recurring chores.

🔓 Unlock new ways of working

Automating recurring tasks can be about brand new ways of working. It need not always mean doing the same steps you did manually with a script.

Take dependency updates as an example:

A new version of the database driver has been released. You want to update it in all 50 microservices. Opening a merge request with the changes takes 60 clicks per service. That's 3000 damn clicks 😱. Even if it's just 50min of work with 1 click per second it would be waaaaay too soul-crushing 😞. You decide to skip the driver update.

Enter Renovate Bot. It automatically creates pull requests for dependency updates. Now it's just a couple of clicks for every service to click the merge button. It also works for all dependencies, not just that specific database driver. And since it's a cron job you get 🔔 pinged weekly about new versions.

This new way of working has valuable side effects, such as improving the overall security of the software by updating to new versions with security 🐛🔨 bug fixes promptly.

📝 Summary

  1. 🔁 Human nature may lure you to stick with bad manual habits.
  2. ⏱️ Automation will not initially be worth it.
  3. 📈 First you must automate at a loss to become good at it.
  4. 🧠 Store your scripts in git repo and eventually you can re-use code.
  5. 🤖 You will increase consistency and quality, not just save time.
  6. 📅 Automation may save you when your career advances and time becomes scarce.
  7. 🧑‍🤝‍🧑 Invest in the automation when blocked. Then leverage that automation to not block others.
  8. 🧳 You will eventually switch jobs. Investment in yourself and automation is retained.
  9. 🔓 Automation can unlock brand-new ways of working.

👋 Okay, thanks, bye!