Naming Convention for
Files, Directories, and Programming Variables

When to use this convention: file and directory names, variable names in programming, naming layers or objects in Photoshop (and other programs), and any other digital object name.

If the program use names files/variables for you, follow the naming structure of the program, since other people may be using that same program and file structure. Otherwise, use this naming convention.

Ø Use “camel” case.

o namingconventions.txt = namingConventions.txt, or NamingConventions.txt

Ø Do not use spaces.

o Naming Conventions.txt = NamingConventions.txt

Ø If spaces are absolutely necessary, use an underscore or dash.

o Naming200920081111.txt = Naming2009_20081111.txt

o (However, in general, avoid underscores and spaces.  Underscores are not part of the XML standard.)

Ø Do not use abbreviations unless common (e.g., WWW, NAFTA)

o NmgCnvtns.txt = NamingConventions.txt

o However, WorldWideWebConventions.txt = WWWConventions.txt

Ø Avoid prepositions and articles. Use strong, clear nouns and active verbs.

o OnTheNamingConvention.txt = NamingConvention.txt

o ElectronicManuscriptsHavingBeenShifted.txt = MovedFiles.txt

Ø Use {filename}V##.{extension}, if versioning is needed (use at least 2 digits).

o NamingConventions20082.txt = NamingConventions2008V02.txt

Ø Use YYYYMMDD format without punctuation, if date is needed.

o Naming2008ConventionsNovember11.txt = NamingConventions20081111.txt

o Note: Dates are not recommended, since the files themselves are dated.

Ø Use the directory structure to help with naming.

o WritingsNamingConventions.txt = Writings/NamingConventions.txt

o WritingsClientInfo.txt = Writings/ClientInfo.txt

o It is also a good idea to use plurals for groups of related items.

o Website/WaterSite/… = Websites/WaterSite/…

Ø Dynamic content files should be named for the role of the file.

o WaterWebsiteFrontpage.html = index.html

o NovemberWaterNewsFeed.js = WaterNewsFeed.js (or maybe just NewsFeed.js)

Ø Use a separate “final” or “output” directory where it makes sense.

o working/Flash.fla; working/Flash.swf = working/Flash.fla; output/Flash.swf

o Note: Avoid using “final”, “draft”, “workng”, etc. within the filename.

Ø If all else fails, at least be consistent.

o ThisHere.txt;
SomethingRelated.txt = ThisHere.txt; ThatThere.txt

o Fall2009.txt, 2009Spring.txt = 2009Fall.txt, 2009Spring.txt; or Fall2009.txt, Spring2009.txt

– 30 –

Advertisements