What’s in a name – Naming conventions for file names, products, and more
Whats in a name? For Mr. Shakespeare and his cast of players perhaps nothing but when it comes to computers, the make up of a name can have great meaning and power. It’s important to note that how you name a file, product, SKU, etc. can become an issue especially if you become too creative.
With modern files systems we’ve all become accustomed to creating long, descriptive file names that may include spaces and special characters. A file name such as “Ann & Bills Wedding – Aug. 2013″ is perfectly acceptable and the name tells us a great deal about what the file contains. However, it can create problems when a program tries to deal with the name especially when we start using it on the Internet or with a cart such as ShopSite.
Hello, hellO, HeLlO?
The first point to note is that on Unix/Linux servers such as we run at LexiConn, file names are case sensitive. This means that the server sees hello.html and Hello.html as two different files. If you happen to be creating files and links on your site keep this in mind; links may not end up working as you’d expect them to!
Copy and Paste Confusion
While we are talking about OS’s we should also mention an issue that comes up when you cut and paste from a Microsoft program such as Word. Microsoft applications sometimes use characters that are not part of the standard HTML specification. When you copy something and paste it into a program such as ShopSite, you may be including characters which are not what you think they are. This is quite common with quotation marks where Microsoft uses a variation of the simple quotes we may be expecting. If you copy and paste via Windows Notepad extraneous data should be removed. TextEdit on a Mac can also be used to strip style data. One other point regarding copy and paste — watch out for leading and trailing spaces. It’s easy to grab an extra space or two as you quickly grab some data.
What Language Are You Speaking?
Some characters can also have special meaning when used with specific programs or technology. For instance, the pound/hash symbol “#” is can be used to signify the text following it is a comment and not code to be executed. This same symbol is also used for named anchors in HTML.
Along with special characters it’s also best to stay away from spaces in file names. Spaces may make something easier for you to read but can get in the way of computer programs. True, they are just another character but when they become part of a URL they need to be encoded. If a URL contains a space you will generally see it represented as %20 in a browser. .
Helpful Hints
You may want to take a look at a blog post of ours from a while back that talks about file naming for some additional information. Michigan Tech also has a nice page with a list of characters to avoid in directories and file names. Note the last rule they have listed regarding the use of hyphens. As a side note; for Google SEO purposes hyphens are the preferred way to break up a file name.
Here’s a quick synopsis of things to keep in mind:
- File names are case sensitive
- Be careful when using copy and paste
- Avoid spaces and special characters whenever possible
Let’s talk a little more about that third point as this comes up quite often especially when dealing with ShopSite. Spaces are certainly allowed in product names. Even the ampersand should not be a problem. A product called Red & Blue Bear is certainly much nicer than RedandBlueBear. When it comes to product options however; check for special characters if you start experiencing problems with a product not working correctly. Under certain conditions using the ampersand in a product option (or menu item) can cause issues. Use “and” rather than “&” and you’ll be safe. Using double quotation marks for “inches” can also be problematic. The same goes for SKUs, it’s best to stay away from special characters other than the hyphen.
It’s important to keep these ideas in mind whenever you’re naming a file, a product, product option, creating a link, or even deciding on a SKU format. Keeping things simple will pay off in the long run.