W01 Learning Activity: Naming Conventions
Overview
When working on the web, there are many things that affect the operation of the files—the browser, the protocol(s), the operating system, the language(s), etc. While many of these are out of your control, there are steps you can take to help keep things consistent and manageable through standard file and folder naming conventions.
Prepare
The file and folder naming conventions will be considered 'best-practice' rules for this course. These rules should be applied to all files and folders created in your course work.
Note that most organizations have defined a standard convention for naming files and folders in addition to other workflows. These conventions may vary as each organization will have their own file management guidelines and best practices. Regardless of the choice, having consistency across an organization is very important.
Naming Conventions
You will be expected to follow these naming conventions throughout the course.
- Use all
lowercase
syntax, for example,
products.html
Platforms and systems handle case sensitivity differently. Case sensitivity is an important concept to understand when managing files and folders.
- Do
NOT
use
spaces
in names. Use dashes instead, for example,
design-document.html
Spaces are interpreted poorly by user agents. Do not use them. The Hypertext Transfer Protocol (HTTP) ignores spaces, except in file names. In file names, it replaces a space with a symbol—"%20
." This makes URL's look confusing and can also lend itself to confusion in the mind of site visitors. So avoid using spaces. Instead, if you have to create a visual space, use hyphens/dashes. - Do
NOT
use
special characters in names, for example,
<,>, \, /, #, ?, !
Special characters often mean specific things to computers, so just avoid using them completely in the naming of files and folders. - Use names that are as short and as meaningful (semantic) as possible, for example,
winter-scene-sm.png
is better thanimage13-v123523brokenbranchlifeimagery w200x200.png
Short, meaningful names save you, other developers, and site visitors from having to remember long complicated names for files and folders. When meaningful, they also help predict the purpose or nature of the file or folder contents when working with those files or folders. - In this class, the
standard folder names
for the sites/subfolders are:
- styles – Folders with this name contain the CSS files.
- images – Folders with this name contain the images.
- scripts – Folders with this name contain the JavaScript files.
Optional Resources
- Dealing With Files – MDN