Dashes vs Underscores

Dashes vs Underscores is an ongoing debate about whether it is better to use a dash, or hyphen, in file name or to use an underscore instead. Over the past few years I have always used the underscore both at work and in home projects. This was for two reasons - the first being that underscores make the file name easier to read and secondly it means that I can use hyphenated words correctly in file names.

Example:

my_day_out_with_co-pilot_paula.jpg

my-day-out-with-co-pilot-paula.jpg

I think that the first is far more readable than the second from a grammatical sense it is correct. However there seems to be a great deal of talk in the SEO communities, and especially from Matt Cutts of Google, that hyphens, dashes are better than underscores in file names hence the Dashes vs Underscores debate.

Matts argument is that Google reads underscores as part of the word and that the dash is seen as a separator. This would mean that “co-pilot” is read and co and pilot by Google and co_pilot is read as a single word “co-pilot”. Hang on though this is back to front - the wrong way around! This would mean that all my hyphenated words in file names should have underscores to allow Google to correctly read them.

Hence the best file name for the jpeg file above should thefore be: my-day-out-with-co_pilot-paula.jpg which is just semantically silly.

The reasoning given found in a post on webmasterworld behind this is that it was to allow techies like us to search for HTTP_USER_AGENT and not have to sort through millions of results containing “HTTP”, “user”, and “agent.” But why would they not use quotes to get the correct term?

So I did some searching on this term in Google and these are my results:

Dashes vs Underscores searches on Google Search term – Number of results

  1. HTTP_USER_AGENT – 1,440,000
  2. HTTP-USER-AGENT – 3,240,000
  3. "HTTP-USER-AGENT" – 3,220,000
  4. HTTP USER AGENT – 138,000,000
  5. "HTTP USER AGENT" – 3,220,000
  6. co_pilot – 1,230
  7. co-pilot – 7,740,000
  8. "co-pilot" – 4,070,000
  9. co pilot – 95,200,000
  10. "co pilot" – 4,070,000

Interesting reading I think. With the first search term HTTP USER AGENT numbers 4 has the most results as it is just the three words but 3 and 5 are the same suggesting that Matt Cutts(and reiterated again recently) is correct in saying that hyphens are seen as spaces. 8 and 10 would also confirm that this is a fact but if the hyphen is the same as a space then 7 would be the same as 9. So adding the dash without the parenthesis does do something.

So am I going to change all my file names to use a dash? No. Like Shawn Hall I have had very favourable results using underscores and especially from Google. What Matt Cutts is saying might be technically correct but grammatically it is the wrong solution. Other search engines will resolve this correctly and perhaps Google will soon follow.

By Simon Cox Published: Thu, Jun 1, 2006

Next short: You can lead a horse to water...

Previous short: 2 ton iron coal wagon

Latest Shorts

Or all the short articles

Latest articles

Or all the articles