(Non) Laziness

Categories: Programming, Thoughts
Tags: No Tags
Comments: No Comments
Published on: February 10, 2007

I've heard it said in many conversations, blog entries, and articles that people automate tasks because they're lazy. I disagree. Often, this “laziness” is in the context of programmers writing scripts to do some mundane operation over and over. They're supposedly lazy because they don't want to do the task themselves.

From the external view point of seeing a programmer who wants to sit back and watch the computer do their work for them, I can see how someone could come to that conclusion. However, most people don't know how hard programming is. It takes effort to design something that makes life easier because we have to evaluate all the steps it takes to do something manually and tell a computer how to do those steps. Writing a program to automate a task is ALWAYS more difficult than simply doing the task yourself.

Let's look at an example. Say you need to rename 50 files in a folder, appending a date found in the first line of each file to the filename but leaving the extension the same. The lazy way would be to just start manually looking at each file then renaming that file. Laziness does not look for a way to speed up an operation or try to get a job done more quickly.

But if you work intelligently, you'll quickly realize that by writing a simple script, you can save yourself lots of time–and in many cases reduce errors (humans tend to introduce errors when they do a task over and over). In the above example, it's fairly easy to find tools that can examine the first line of a file and set an environment variable with the date contained. Then the next step would be to separate the base part of the filename from the extension, use the environment variable containing the date to append to the base filename, then reattach the extension and assign this as the new name for the file. Put these steps together and in less time that it would take to manually rename all 50 files, you've got something you can use over and over and can be changed slightly for various situations.

It takes realization of a repeatable task, design effort (brain power), and often research to build a program–even a simple one such as the script described above. Laziness does not lead to increased productivity, smart thinking and a desire to use your time more efficiently does!

Leave a Reply

Your email address will not be published. Required fields are marked *

*



Welcome , today is Friday, June 23, 2017