Clip Art Website Structure
Pierce Home
Computer Science 555 Website Development using JavaScript and AJAX - 3 Units
Section:
3179
Instructor:
Brad Gilbert
Pierce Mailbox:
612
Email:
pierce@wavethunder.com
Wednesday Office Hours:
5:00 -   5:40 PM COSC 1507
Wednesday Lab:
5:45 -   7:50 PM COSC 1507
Wednesday Lecture:
7:55 - 10:00 PM MATH 1511
Other classes:
CS-575
website structure
Question:

What is the proper structure for a website?

Answer:

Definitely do not just have one folder with all of your files in that folder. Most websites have an image folder to store their .jpg and .gif files. Some have a media folder for sounds and videos, while others may have a separate folder for scripts and one for style-sheets. For small sites with only 1 or 2 scripts or style-sheets, these folders may be unnecessary, but don't overlook that your site may grow. Also, a word of caution about placing style-sheets in a separate folder: References to other files, such as images, are in relation to the style-sheet, not the webpage, whereas references to other files in JavaScript are in relation to the webpage.

Typically, the root folder contains welcome files, sign-on files, "about" pages, and other site-generic files. If you have an online electronics store, for example, you might then have folders for TVs, video games, cell phones, etc... For this class, you should have a cs555 folder, and inside that, folders for each of your labs.

Also, note that many web-servers are case-sensitive, so building a link to lab1 will not work if the folder is named Lab1. That is why many web developers use all lower-case for folder and file names. Finally, do not use spaces in your folder and file names. Some browsers convert spaces to %20 and some do not, which could cause confusion at the least, perhaps extra work when you write scripts for links, and could even break your scripts at the worst! Notice how a file named "in de x.html" can become "in%20de%20x.html".

Question:

Is there a standard naming convention?

Answer:

Names should be short, descriptive, and flexible. For example, a folder named "picturesofmyhomeinwoodlandhills" is certainly descriptive, but definitely not short or flexible. Add to that a handful of web-pages and dozens of pictures similarly named, e.g. "picturesofmylivingroominwoodlandhills", and you have a website maintenance headache when you move to Calabasas!

Simply "house" may be a better naming convention. Consider "myhouse"; what happens when you get married? Or "ourhouse"; what if you get a divorce? With "house", you can change the content, i.e. the pictures, without having to restructure/rebuild your website. Keep in mind, when you change folder and file names, you risk breaking links that your visitors saved in their browsers' bookmarks and favorites! The content can and should be more specific, such as a caption that reads: "Here we are, standing in front of our new home in Calabasas."

Naming folders and files is definitely more of an art than science. As stated above, names should be short, but not so short they are cryptic - where a once so-clear meaning is soon forgotten 2 months later. Beyond that, the challenge is to strike a balance between too specific, and too generic. Names should help your website, not hinder it, and they should fit within the context of your website, as well as within the community of visitors to your website.

Why is context of the community important? Because you want visitors to find your website when they enter keywords into search engines. Selecting the right names could make the difference between a bustling website and a ghost town.

Question:

Should I have a separate development website?

Answer:

Emphatically YES! You should develop your site on your local computer, then upload your changes to the web-server. Your development website should have the same folder structure as the production website on the web-server. If your web-server supports FTP (File Transfer Protocol), you can use your OS (Operating System) FTP, an FTP client application, or website development software such as Dreamweaver, to upload your files. You might even have a test folder on the web-server to test your files before placing them in a production folder for all-the-world to see.

Question:

Should I backup my website?

Answer:

Definitely! Many web-hosts provide website backup/archive capabilities, such a compressing folders (and files) and placing them in a zip file, which you can then store on the server, your local computer, and/or offsite media.

If you have a database, your web-host should provide the means for you to backup your database as well, including downloading and uploading the backup. Your web-host would also provide the means to restore your production database from your backup. Additionally, your web-host may enforce security restriction on backup/restore procedures. Finally, your web-host may perform routine system backups of your database.

Brad Gilbert · Fall 2011
Computer Science · Pierce College · Woodland Hills CA · 818-719-6401