Tuesday, April 06, 2004

Wrote something cool, saw something cool

Wrote something cool
So as a programmer, it is in my best interesting to be lazy. Not afraid of hard work lazy, and not slacker lazy. I mean lazy in a way that I never want to write the same code twice. Moreover, I don't want to write code, that I can generate with other code. Funny enough about this kind laziness, you can spend longer on writing a solution, then just doing the task at hand. Fortunately I broke even today. So what I wrote today, is a little utlity, that you feed a xml document, and the xsl stylesheet that your wrote for the xml, and it creates a html file from your xsl. So including the xsl I wrote 270 lines of code (145 for the xsl, 125 for the utlity), to create an html document, that only has 185 lines of code. Why would I do that?

Several reasons come to mind. First, accuracy, the xsl is going to more accurate, in writing the links, that I am going to be. In 185 lines of code, there are 150 links. Anyone would started to get a little bored and start to let their mind drift off, and the links won't of been as accurate because they are thinking about lunch or that movie they just saw. Second, flexibility, what if tomorrow, my boss says hey, 'Russ that looks great, but lets try this format instead'. Correctly changing the html page around could take a lot of time. However, changing the format of the xsl, is much quicker, and I can regenerate the html in half a second after the xsl is finished. Finally, that laziness factor we were talking about earlier. I don't want to write the code, when I can have something else do it for me.
An example of this would be the electric handsaw (skilsaw). Now you know it took longer to make the first skilsaw, then it did to cut 10 boards. But did it take longer to create the skilsaw then it would of taken to cut 5000 boards? Probably not.

In a couple days once I get my little utility all polished I will post it. I still need to write in some error checking and clean up the UI. (Ed we can do a command line version if you want :-> )

Something cool I saw
Checking the logs today I saw that I got a someone who came to my site from a yahoo.com search. I was pretty please to see with the keywords "Real Life Adventure" I was ranked 6th on the search results. So, I am thinking, right on, movin my way up the search engine ladder. Out of curiosity I typed in the title of my blog "Adventures in Real Life" and I came up ranked 2nd in the search engines. Now how cool is that.

No comments: