Automating because you can

I like to automate things I do. It’s generally good practice to find ways to avoid repeating yourself. especially as a programmer. However, I find it easy to fall into the trap of automating just because you can (or assume it is always better to).

It helps to take a step back and consider the facts before automating:

  • How long will it take to do this manually?
  • To your best knowledge, at this present point, how many times are going to repeat this?

Note, that you are looking at historical data ONLY when you decide to automate. No wild guesses about what you need in the future (keeping in mind how bad we all are at predicting the future).

This gets you out of the trap of automating something that takes 30s by spending 15 minutes writing a script to do it. Sure, after 30 times you make up the cost, but do you really? 

There’s a hidden cost with automating, and that is distraction. You stop what you are doing and go off and start something else in order to automate the step. So you end up losing focus and getting side-tracked.

Remember there is an opportunity cost to automating. So if it will only take you 30s to type out what you need, and it will get you to the next point in your project, then perhaps, you should skip over the automating and keep going (at least the first few times anyway).