Naming

One aspect of site design that can unexpectedly come back and bite the author is that of naming and text format rules. This splits into two sections; text that will be visible to the site visitor, and text that forms part of back-end code.

As an example of the first, do you log in, log-in, or login to a site? Likewise, is the site using apache or Apache? And should that title over there say "Other Projects" or "Other projects"?

(It occurs to me that the above sentence may have made absolutely no sense to a screenreader. Suffice to say that the question is one of capitalisation and hyphenation differences.)

These may seem like pointless and arbitrary considerations, but they can make a significant difference to a site's consistency and usability. (As I type this I note wryly that I have h3 headers on the front page called "Other Projects" and "Greater minds", proof that I've not yet set the rules myself). Other considerations include: Do list items end with a full stop (period) or not? Do titles use ampersands (&) or the word 'and' ? And there are almost certainly more I've not considered.

Rather than actually answer these questions right away (and to keep the entry length down a bit), I'll invite you to look at a few other designer's sites to see how they handle the decision: Eric Meyer's site at http://www.meyerweb.com/ , Jeffrey Zeldman's at http://www.zeldman.com/ , and Mark Pilgrim's at http://diveintomark.org/ .

Addendum: Decide which voice (and tense) you're writing in too. I seem to be veering wildly between "I" and "We" in some posts; I'll blame this on the flu I've still not shaken off.

The other side of the issue lies in names in code - in variables, database table names, and filenames. There's a number of schools of thought on this one, but personally I prefer just to stick with simplicity, clarity and consistency - decide whether an image collection is an album or a gallery, for example, and use the same term across all namespaces.

I'm still in two minds on using library prefixes in function names to avoid collisions (all the Infinite Penguins functions start with ip5_, for example) - comments on this will be appreciated. One variable name that's almost guaranteed to cause problems with external code sooner or later is $page - try and avoid overly generic names.

One place where I'm more convinced by the use of prefixes, however, is in database table names. Group them sensibly and you'll be able to remember what they do when you come back to a project later. As a poor example, I have tables in InfinitePenguins for bookmarks of ext_link and link_cat (and an unrelated 'link' table), but my livejournal tables are rather better - named lj_journal, lj_post, lj_mood and so on.
Posted by parsingphase, 2004-04-10 13:06

Anonymous user

Login

Blog

Contact

I'm currently available for contract work in London as a Senior PHP Developer. Contact me for a CV, rates, or a chat.

Twitter @parsingphase
Email richard@phase.org
Github parsingphase
LinkedIn Richard George
Flickr parsingphase