SEO and title tag density

How does keyword density in the title tag affect search engine placement? On Facts about Title Keyword Density, it says that Live.com rewards high keyword density in a title tag, whereas Google.com punishes high keyword density in a title tag.

I don’t really care about search engines other than Google. I’ve heard SEO experts claim that Yahoo! and MSN/Live still contribute a fair number of clicks, but that’s not true according to my server stats. I’d like to find out if Google really does punish keyword density in a title tag.

I created 3 similar pages for a fictional person, whose name currently return zero results in Google. Using the name as the search term, there are 3 different keyword weights.

  1. Test A (100%)
  2. Test B (50%)
  3. Test C (9%)

This may not be the best test methodology, but at least it’s a start. In a few days, I’ll see how Google ranks them. Any opinions on how the pages will rank?

The Greater-Than Gator

I lost a lot of time yesterday thanks to tracking down an alligator in an import utility. There was one itsy-bitsy little function that wreaked big havoc, thanks to a confused gator that didn’t know which way to look.
Greater Than Alligator
That’s right, there was a < when there should have been a >. (Or since it was ColdFusion code, there was a LT where there should have been a GT.)

The import utility was developed by a guy with a masters degree in computer science, so it just goes to show you that no amount of expertise can prevent such an error (or, quite possibly in this case, a typo).

It was an easy fix, of course, but fixing all the data that had been incorrectly imported in the past took a bit longer. It cost me a few hours, but that’s better than causing a credit crisis. Either way, it reinforced in my mind the idea that we could use some unit testing around here. Sure, it might take a little extra time to write the tests, but probably less than the amount of time I spent hunting down the pesky little gator and fixing the mess it left in its wake.

UI Complaint: submit buttons above the form content

I have seen numerous instances lately where a web application requires the user to look above the form or content to instigate the next step.

Examples:

  1. On bordersstores.com, a 6-page list of books has the navigation at the top (and only at the top). After you scroll through the 25 items on the page, you have to scroll back up to the top to access the links to the other pages:
    Borders bad UI example
    Hint: the links should be both above and below the content.
  2. On Wharton’s webCafé, the “OK” button is located above the login form on a toolbar with a different background color: WebCafe Bad UI Example
    Hint: it should be underneath the login form, and it should be labeled “Sign In” instead of “OK”.
  3. In Microsoft’s Windows Live, the “save” button is placed above the form in a toolbar with a different background color: Windows Live Bad UI
    Hint: put the button below the form. (At least the button is labeled appropriately.)
  4. In the latter 2 cases, one could argue that the button placement is similar to what a user would expect to find in a desktop application, such as Microsoft Word. But it isn’t a desktop application: it’s a web app, and users expect to find form/page actions at the bottom of the form.

    You could also argue, in the last case, that the user may want to make a quick edit to the name information without editing all the details. Therefore, it is more convenient to put the “Save” button at the top. That’s fine, but why not offer 2 “Save” buttons, and put one in the spot where user’s most expect it?

Checking for date-time conflicts

It seems like I’ve worked on a lot of applications lately that involve time slots: room reservation systems, appointment schedulers, and so on. One thing that tripped me (and some other developers) up at first was checking for conflicting time slots. It turns out, there are a variety of possible conflicts:

Conflicting Time Slots

There are 5 unique conflicts possible, and it seems like I’m always forgetting one.

Continue reading Checking for date-time conflicts

The Javascript Dollar Sign ($) Function

Recently, I’ve been seeing a lot of Javascript functions prefixed with a dollar sign ($) or simply named $. I thought, what sort of magical property does the dollar sign have in Javascript? What sort of esotericism had I uncovered?

The Dollar Sign Magician

I checked the O’Reilly Rhinoceros book, and found that the dollar sign has no special properties.

However, I have come to discover that dollar sign function has become the more-or-less de facto shortcut to document.getElementById(). Let’s face it, we all use document.getElementById() a lot. Not only does it take time to type, but it adds bytes to your code as well.

Here’s the version from prototype.js, which can return more than just a single element:

function $(element) {
  if (arguments.length > 1) {
    for (var i = 0, elements = [], length = arguments.length; i < length; i++)
      elements.push($(arguments[i]));
    return elements;
  }
  if (Object.isString(element))
    element = document.getElementById(element);
  return Element.extend(element);
}

Because it has become a common shortcut to document.getElementById(), it means that various Javascript libraries should play nicely together: if the dollar sign function in one .js file is overwritten by the same dollar sign function in another .js file, everything should still work. That also means that creating your own dollar sign function that does something different is probably not a good idea.

In case you were wondering, the underscore has no special properties either. But let’s face it, $(‘myVal’) looks more like programming than _(‘myVal’).

Update 2012
By now, the most common use of the $() function is as synonym for jQuery() in the popular jQuery Javascript framework. It returns a jQuery object (or objects), which includes much more than just a reference to the DOM element. (In jQuery, you can still access the underlying DOM element using .get().)

Likewise, the Prototype code I cited above also returns more than just a reference to a DOM element, as it returns an extended version of the element. As such, Prototype and jQuery will almost certainly not work well together in the majority of cases.

Welcome, Chris Petersen!

My friend and former co-worker, Chris Petersen, is going to be contributing to this blog as well.

Like me, he’s a bit of an accidental developer. However, he also has a master’s degree in information science from the University of Michigan School of Information, so he’ll be able to share his expertise on subjects like prototyping and usability testing. He develops primarily in ColdFusion.

Does releasing code to the public inspire extra effort?

About 2 years ago, I created a javascript image/photo gallery to embed gallery functionality into a web site using only client-side processing. Although I created it for a specific purpose, it was generic enough that I decided to make it available for other people to use on their sites.

Imagine my surprise when people took me up on that offer.

Continue reading Does releasing code to the public inspire extra effort?

Object Overhead in ColdFusion

I have been trying to improve the speed of a ColdFusion application. It was written by a part-timer, a Java developer who was new to ColdFusion. He wrote the code almost entirely in cfscript, and he used CFC objects extensively. In fact, it seems that he overused CFC objects—to the point where the server slows to a crawl.

Continue reading Object Overhead in ColdFusion

Clever ways to save bandwidth

When I worked for MLive.com, one of our practices was to leave out quotes around attribute values (except for alt attributes). This was to save on bandwidth costs. In spite of the fact that the page was no longer valid HTML (technically), all target browsers rendered the pages properly.

That might seem like nitpicking, but with over a million pageviews a day, all that ASCII can add up. Personally, I would prefer valid HTML, but I bet the financial side of that decision was pretty interesting. Continue reading Clever ways to save bandwidth