There, I said it.

I’m referring, of course, to my right and privilege to throw down a cat wherever I see fit, especially at the beginning of a command, contra the philosophy detailed, for instance, here.

I understand that the bash command cat may be overused and it may even cause certain problems, but that is hardly the issue.

If I was employed as a system administrator, things would be different. For instance, were I to write a script that might be used every time a log file is written to, and this log file might under certain conditions get written to a few hundred times in a second on some company’s server, it would be my responsibility to be as efficient as I reasonably could in writing that script. But, if I was me, writing the occasional script to do some dumb stupid thing that only I need, like automating the fixing up of the blogroll for my sidebar or something, I can absolutely afford to be utterly inefficient.

Indeed, inefficiency is probably more efficient. The whole time I’d be there rewriting and testing and rewriting and testing a script to maximize its efficiency for the 20 times I’ll ever run the damn thing before I stop doing it that way, I could be doing something else, and so could my computer. Even counting processor cycles or some other irrelevant esoteric thing, my cat-riddled inefficient script is easier for me to create and debug, and will in the end use fewer cycles because I write it once, debug it once (tops) and run it 20 times, as opposed to write it once, debut it nine times, then run it 20 times.

Sure, I get it: If I knew what I was doing, I’d write the script efficiently in the first place. But since I don’t know what I’m doing, it’s much more efficient for me to use very linguistically English seeming sequential structured easily parsed and easily debugged scripts. You would laugh, I know, to see some of my scripts run, because I often have them echo statements telling me that everything is OK, for debugging purposes, but once it all works, I leave those in. Talk about wasted computer power!

Here’s the bottom line: The existence of a macro language at the application level does not obviate or even speak to the importance of efficiency at the system and application development level. And, visa versa. And, there are some of us out there who use the command line as, effectively, a macro utility.


  1. #1 SimonG
    August 5, 2010

    Times change. When I first started in IT I had to avoid unnecessary instructions and even bytes of storage. These days, processing and storage is cheap. In fact, it’s less costly than the time of a skilled programmer or administrator. It’s therefore often good practice to write “bad” code and just throw some extra money at the hardware.

    Of course, there are still occasions when efficiency is cost effective and I think it’s worth maintaining good coding practices if only to make it easier to cope with those occasions, and because that little routine you knock up today might well last longer and grow bigger than you ever imagined.

  2. #2 Carlos
    August 6, 2010

    The people who complain the most about doing the coding just right to avoid processes are often the same people who will thoughtlessly choose an interpreted scripting language over hard coding and low level languages any day.