Web site principles
These are the loose principles that I try to keep in mind when creating
web sites, in approximate order of importance.
(Regrettably, not all of these principles can be applied on my ISP's
server, where this page is hosted.)
-
Stick to the standards, specifically,
XHTML and
CSS (later
standards, such as XML/XSLT can also be used).
Validate your
XHTML, and
validate your CSS.
-
Make your pages adaptable. Don't use absolute
font sizes, always specify background colours when you specify
foreground colours. Test your page with several browsers
(if possible) and window sizes. If a page is intended to be
printed, test it in print preview!
-
Don't make your page depend on images.
Specify
alt properties, especially for headings.
Test your page without any of its images.
-
Use
PNG
images, because it's a standard (as well as a good format).
Don't use Flash or ActiveX or Java applets unless you have to.
-
Use Apache 2, because Apache runs well on a wider
range of systems than any other server. If you need to change your
machine or operating system, you won't need to switch to a different
server.
-
Use correct HTTP
methods for forms. Generally,
use POST if the form will change data in the server (or contains
uploaded files); otherwise use GET. If a GET request causes a
large server load, consider caching the result.
-
Use simple and obvious URLs. Names
should contain no spaces, and be preferably all lower-case,
unless there is a server-wide mixed case standard.
-
Make use of
PATHINFO when appropriate.
If a single web script can generate many resources, consider
using the URL /script/resourcename instead of
/script?name=resourcename. There is nothing worse than
a site where every page is called /display?page=xyz;
that tends to be incompatible with user agent bookmarking and history
lists.
-
Skip the
.html suffix for URLs.
For resources that are text/html or scripts, omit the
.html, .php, etc. From the user's point
of view, it is irrelevant whether a resource is a plain HTML file
or is generted by a script. (The logical conclusion is that no
URLs should have a suffix. In practice, most people prefer it
when images and other non-hypertext resources are clearly
indicated by their suffix.)
-
Don't add unnecessary graphics to your pages,
as they will slow its tranfer and distract the viewer. However,
a W3C logo such as
is acceptable because it will encourage other people to have
correct pages!
Copyright (C) 2003, 2004 Edmund
Horner.
$Id: index.html 2412 2007-01-23 03:08:21Z Edmund $