This is an archive site. For the recent posts, visit orderedlist.com.

Ordered List

OrderedList

May 9 2004

What's in a Name?

In the world of development, organization is key. Web standards themselves are meant to keep things in a unified system, so updating and editing is easier, and understanding the code is faster and more straight-forward. In my opinion, a good naming convention can be the root of all file organization, regardless of the type of file or its usage.

Now, I’m not going to tell you that any given naming convention is better than another; I’m not even going to assume that the way I describe in this article is more appropriate than somebody else’s method. I just want to describe my habits for naming and organizing files. So, with that said, here’s how I keep my web trees neat and tidy:

Practice #1: Keep everything in lower case.

Many file systems (Linux, UNIX, etc.) are case sensitive with their files, so File1.html is not the same as file1.html. Keeping everything in lower-case eliminates all questioning about capitalization, and can eliminate mistyping file names. In addition, I think it just looks better.

Practice #2: Use the Underscore character to separate words.

If you have an HTML file containing information about Albert Einstein, consider naming it albert_einstein.html, not alberteinstein.html or albert-einstein.html. I have heard the argument (and it is a valid one) that some search engines, like Google, do not recognize the ‘underscore’ as a separating character, and therefore should not be used to separate words in web documents. While this may be the case (I’m not absolutely certain about the truth of that statement), I feel that maintaining a more human-readable format is better for my needs. The ‘underscore’ keeps words separated visually, while eliminating those irritating %20’s from URLs.

Practice #3: Go from general to specific.

Say I have a group of images used for titles of three subsections of my page; Menu, Links, and Highlights. Rather than name the files as you would verbally say them (menu_title.gif, links_title.gif, highlights_title.gif) start with the most general term, and work your way to the most specific (title_menu.gif, title_links.gif, and title_highlights.gif). This not only maintains a consistency of image and file naming, but when you view your files by name, all the title images will be listed right next to each other for viewing and editing.

Practice #4: Keep like files together in folders.

In a web file tree, for instance, I place all images not used for CSS style presentation in an ‘images’ folder, all CSS files and corresponding images in a ‘style’ folder, Flash files in a ‘flash’ folder, PDF files in a … well, you get the idea.

There are probably hundreds of other, much less important naming habits that I use, most of them according to personal taste. I’d love to hear about how you name your files and keep your digital data organized. Make comments at your convenience.