Best Practices in Naming Assets

With tight deadlines, many developers cut corners and fail
to come up with a system for naming files and assets. But whether your website
is large or small, it is important to be consistent with file naming. Devise
a set of file naming rules, and stick to these conventions throughout your
projects. If you are working with a team of designers and developers, make
sure everyone understands and agrees to the conventions.

Naming Files

Modern computing platforms such as Windows, Macintosh, Linux and UNIX platforms
are not limited to 8.3 naming and there is no excuse not to use long, descriptive
file names with the .html extension. While 3 letter extensions are common
on PC’s, they are no longer exclusive, even Microsoft’s latest
ASP.NET uses the 4-character extension .aspx for its web pages, so it’s
worth making the move over to the original .html extension.

Avoiding Meaningless File Names

Names that make sense at the moment you name them can become meaningless,
even to you, within a matter of weeks. Take a look at the following page
names that we found on the Web.

index3.htm, wenpg.jpg, dlcform.htm, qamanintro.asp, extmods.htm

Can you guess what these files are or contain? We recommend a naming convention
that uses a plain English approach: quite simply, name things after what
they are or do. For example if you have a page with titled About Us, name
the file, about_us.html.

Naming pages with acronyms is a variation of giving pages nonsense names.
While the pages might communicate something to you or your organization,
they certainly don’t communicate to a general audience. Moreover, acronyms
change over time, so they could lose their meaning even internally. Take
a look at the following examples.

daps.html, daps1.html, daps2.html

daps.htm is the name of front page on one of the sites we found, while daps1.htm
and daps2.htm are examples of file names for the content pages therein. We
have no real way of telling what is in the files unless we open them. Even
when you know you’ll be running your site for the foreseeable future,
in a few months you to could be scratching your head. Acronyms are commonplace
on the Internet, and litter the computing highway. Take the time and write
names out in full, distinguish your files and make browsing your site easier
to understand.

Using Numbers to Distinguish Content Files

Although sometimes it is a good idea to number a series of files, you should
always lead with a 0, so you have 01, 02 and so forth, so that the files
are listed in order within the Site panel. If you number with single digits
and then move up to double digits when necessary, you could end up with a
sequence like the following one: survey1.htm, survey10.htm, survey11.htm,
survey2.htm, survey3.htm, survey4.htm, and so on.

The First Page on a Site

Always name the front page of a site default.html, index.html or home.html—whichever
your ISP specifies as the home page default. The reason for this is that
your users should be able to get to your welcome page without having to type
the page’s full URL. Thus, to get to http://www.phireworx.com/default.asp,
users only need to type http://www.phireworx.com and the server knows to
go automatically to default.asp. If you wish to move away from standard convention,
you will only be able to do so if you have administrative control over the
web server.

Joining Words Together Versus Underscores

Both of the following examples offer a better plain English approach to file
naming, simply because they use descriptive names and they are longer than
8 characters. But there is a rather obvious problem; the words have been
condensed so that there are no spaces, making them hard to read.

whatwecandoforyou.htm or joinOurCommunity.htm

This is partly because empty spacing in files is unadvisable for web pages.
While the first file name makes no attempt to distinguish the words, the
second file name uses the secondary capitals technique to distinguish individual
words. The problem with both these techniques is that once you have a few
files, its makes it very difficult to tell one file from another. We encourage
you to use underscores “_”, changing this file names into:

what_we_can_do_for_you.html and join_our_community.html