Personal Automation as Code Practice

Why automating everything can be good for you

Perhaps one natural tendency of programmers is to want to automate too many things, especially when it comes to their personal stuff. I say 'programmers', because this will surely apply to at least both software developers and DevOps engineers, as two disciplines for which people use programming languages and into which I think people often fall as a result programming as a hobby.

Whilst trying to get something done in your own time, it can be tempting to think '* what if I automated this?*'. It may feel like a procrastination tool, and maybe it leads you down a rabbit hole of stolen time with no useful result. Or you automate a task and only ever do it once, finding that perfect, one-use-only regex — there's that old adage about programmers.

I definitely have this tendency, and of course I make use of it in work environments too, but in a work situation I have to be brutally pragmatic about what is worth automating. For instance, using a build tool to automate your web app build and initiate a watching/reloading task is one of the most common and time-saving tasks for a web developer.

At home however I can engage any flight of fancy I like and I'm sure I'm not alone in doing so, but I think it is mostly a healthy thing. For one thing, being better at spotting tasks that can be automated seems like a useful skill for a developer or anybody who uses programming languages in their job to automate things. For another, it can be a useful excuse to learn a new programming language or tool.

That last reason is why I decided to learn ZSH inside-out several years ago. I'd only ever had a basic, empirical-type of knowledge of shell programming languages, so I had only ever written pretty basic scripts in them. So on late nights after work, I started writing ZSH functions to automate tasks I was doing in the terminal over and over again, and this became quite addictive and fun. It also put me to sleep pretty effectively.

As well as automating things I did often, I set myself coding challenges to do things that weren't useful, just to see if I could, and to see how one might do it in ZSH. It's not that ZSH or shell languages in general are particularly fun or attractive languages to code in, but novelty is a stimulating thing and as a programmer you may as well have a better knowledge of shell languages.

Sometimes a task really was too hard or annoying to code in ZSH so a few tools written in Python or Ruby have been added. In this way I also challenged myself to learn Ruby — and, what is now one of the most valuable tools in my toolbox — regex. Yet another excuse to learn regex!

Overall, as with the personal side-project, I think this kind of habit of developers is a great thing, and really helps to maintain that love for programming, that can sometimes become a little jaded after too much hard work.