Cookie Notice

As far as I know, and as far as I remember, nothing in this page does anything with Cookies.

2012/03/27

What Is False Laziness?

I have code. It takes data from an instrument, copies it to a local filesystem, and, under certain circumstances, makes an R file, runs it, and copies the resulting image into a directory.

Then I got another instrument. It ran similarly but on another machine. What's the easiest way to get this working? Copy the code, make changes relating to the specifics of the second instrument, add a new line into the crontab, and go onto the next project.

Now, we have three different outputs that we want to relate this data to, and none of it was around when I first started maintaining the first code, much less forked it into the second code for the second instrument.

So, now, if I want to make a change to handle a case for the first instrument, I have to copy that change into the second instrument. I failed to honor DRY, "Don't Repeat Yourself". I can justify it by saying I didn't remotely understand how to write libraries then, but I know that is only justification. I was falsely lazy, not truly lazy, and gave myself problems that are just now coming to view.

If you'll excuse me, I have to read up on Mouse and OOP on MetaCPAN.