Yesterday, while I was working on a project, I noticed a few bugs in my code. They weren't big bugs, the files just needed to be updated a bit because other things in the project had changed. I quickly grabbed a piece of paper and my favorite pen and started jotting down notes about what the code was supposed to do and how I should go about writing it (I do this for almost everything but the most trivial problems, it helps me think.). After a few minutes I had designed a method of fixing my problem that looked like it would work well. Quickly scanning over my notes I realized that there was going to be a bit of repetition in my code. "Oh no," I thought, "repetition! thing of the devil! Because I am a Perl hacker this must not stand!" I grabbed another piece of paper and started scribbling away some more, trying to find a way of fixing my problem without having any repetition. After half an hour or so I can up with a truly wizardly solution. Scanning over my notes again I realized that even though all the repetition was erased my code was longer, uglier, and horribly complicated. "Fine," thought I, "I'll go about the brute force method if my magic isn't going to serve me well." I began to reach for a third piece of paper, but instead I sat back and thought. "Wait," I thought, "this really isn't a very complicated problem. I don't need magic or monstrous strength to overcome it. All I really need is a well placed skill, without trying to out-do myself." Keeping this in mind I quickly wrote a small, but efficient, piece of code. It did have a few lines of repetition, but I didn't let that bother me.
There you have it: the sword, the sorcery, and the spoon (I used the word spoon partly because it sounds nice with swords and sorcery and partly because with some carful placing you can do a lot with the leverage of one spoon.). I think the moral is pretty obvious, but I'll repeat it here: use what works best, and don't overestimate the problem.
If the title brings odd pictures into your mind, you're not alone. When I read over this I get a picture of a Warrior of Perl skillfully beating back Aragorn and Gandalf as they attack him with all their might. Hope this helps somebody, TMTOWTDI!
-Ben Jacobs (dooberwah)
"one thing i can tell you is you got to be free"