Automating Repetitive Tasks

One thing that's nice about being a programmer is the ability to automate your own repetitive tasks. If you need to fill out a time sheet, then add up your hours for different tasks, you can program something to automatically tally that up for you. If you need to run a script on a client's data and send to results to their accounting department every week so they can verify everything is calculating correctly, you can write a small application that will run the query at the specified time, write it to a spreadsheet, and send off the email, such that you don't have to do anything with it anymore. It's a great time-saver and frees up your brain to do other important things. Over time, as you go through the process of doing repetitive tasks and writing software that automates tasks, you'll come to get a feel for what could be made automatic and whether or not it's worth it to implement that automation. Here are a couple of things to consider when deciding whether or not to do so: Consider how long it takes you to do the tasks, how frequently you do it, and how long you will be doing it for. Here's some sample math: 5-minute task, once per week for a year: 260 minutes or a little over 4 hours. The automation is of questionable value if it will take you more than 4 hours to implement. 1-minute task every work day for 10 years: 2600 minutes or 43 hours. The automation could take you a full work week and still be useful. Consider that having to do any additional task, even if it's only one minute, can break your concentration. If you're in the zone with a certain project, then you have to take time out to do your repeat task, you lose concentration which will take time to spin back up once you're done with that task. It actually costs you more than just that one minute. So if you only break even with respect to the time saved actually doing the task, it could still be worth it. Depending on what you're automating, it could turn out to save you even more time than you thought. For instance, suppose you're creating a tool to generate test data rather than creating the data by hand. It would take you 4 hours to manually enter all of the data that you expect to enter and it would take you 4 hours to create the tool, which could generate the data in a minute or two. I've been in this situation and creating the tool ended up saving me more than 4 hours because I was entering the data wrong. I didn't discover until after trying to use the test data that it wasn't useful without a certain field entered and I couldn't enter it after it was already created. If I had done it all by hand, I would have had to spend another four hours generating the data correctly. Instead, I just made some minor tweaks to the tool and ran it again. A couple of minutes later, I had the correct data entered. And finally, don't forget to first look around to see if someone already wrote a program to do what you want to do. Then you get the best of both worlds. You don't have to waste time on the repetition and you don't have to spend time pulling your own tool together. I hope that's helpful. Happy Automating!

Comments