Gareth Lennox

Category Archives: programming

Google and search ranking

I’ve recently finished a new site for a client, and in the process of developing, I uploaded a test site to a web server for the client to review. Since going live with the actual site, I left the test site up and running (in the assumption that its less effort to leave it up […]

Empty unit tests

I was reviewing some code, and noticed a couple of unit tests that had “TODO” comments in them (and no code). The problem is that when running these tests, they were passing. Someone reading the list of tests would assume that the test was testing what it claimed to be testing, when in actual fact […]

How to sort rated items

This is a fascinating article: PROBLEM: You are a web programmer. You have users. Your users rate stuff on your site. You want to put the highest-rated stuff at the top and lowest-rated at the bottom. You need some sort of “score” to sort by. The article goes into detail about how all the most […]

Commented out code

One of my pet peeves is opening a source code file, and seeing half of it commented out, or blocks within it commented out. What’s wrong with this? Commented out code serves no purpose, other than to confuse. If you try uncomment it, chances are that the code around it has changed, and the uncommented […]

Learning Zend Framework

So, I’m playing with Zend Framework. My initial impressions are that it seems very cool. The database stuff especially. One thing, and this is not limited to the Zend Framework, is that it’s such a big system, there is a lot of stuff to get your head around, so documentation is critical. Unfortunately, the documentation […]