Skip to main content

Web Standards, Part I: Conversion to Web Standards

This article was originally posted at Blogs@SI on April 22, 2005.


DoctypeJust having served on a panel that presented to Penn State Web developers about converting to Web Standards, I'm reminded once again that the biggest challenge with talking (or writing) about this subject is figuring out what on earth can be said that already hasn't been discussed six ways to Sunday. And not only by the Web Dev community in general, but by individuals such as Jeffrey Zeldman and Eric Meyer.

Well...

The fact is, Web developers interested in going this route but who aren't quite ready are looking for a solid starting point and a process that minimizes reworks. That's the approach I took with this audience, and it is the approach I take with my own development:

1. Build incrementally and validate early and often.
This comes second nature to applications programmers: By building an application a little at a time and testing after each increment, debugging is confined to small blocks of code. Instead of entire pages. There are lots of validation tools available, including w3c's validators. I primarily use FireFox's Web Developer Extension (chrispederick.com/work/firefox/webdeveloper) to validate XML, CSS, and other code. This combines a useful set of tools with the most standards compliant browser on the scene. Even though I may not have made changes recently in the style sheet, I validate this incrementally as well. The reason: errors in code can throw themselvs out as CSS errors. Of course, frequent validation will not take the place of careful coding. For one thing, code can validate but still contain problems. For another thing, the more carefully you code, the less cleanup you will need to do after validation.

2. Start with a completely new development environment.
Many developers disagree with me here. They prefer to work with existing files, cleaning up legacy code as they go along. My thinking is, if the site is in need of conversion, it likely has a whole lot of other issues that should be addressed as well: overall architecture, dynamic code and queries, administration and workflow, database structure, page design, and content. Converting to WS without addressing these issues is a bit like putting new guitar strings on a milk crate. Starting with a new, clean dev environment also does wonders for your mental state. It just feels great to leave all that junk behind.

3. If you're new to WS, make sure you take the time to choose the correct doctype.
Your doctype is the backbone of your Web page. You should go no further until you are confident that you have this set up correctly. I could say a lot more about this, but Jeffrey Zeldman says it better: alistapart.com/discuss/doctype/4.

4. Organize your style sheet in a way that makes practical sense, and comment this organizational scheme.
Keep categories of styles together according to their functions: tag styles, formatting, classes, and so on. This is just common sense, I realize, but it's shockingly easy to allow a style sheet to rage out of control.

5. Give semantic names to styles - and other page elements such as includes, for that matter.
If you name a div "lefthandnavlinks," what happens when the site gets redesigned and they're no longer on the left hand side of the page? Your div name makes no sense. There's a better reason for semantic naming, however: it enhances accessibility: w3.org/TR/1999/WAI-WEBCONTENT-19990505.

6. Develop a cognitive map of the Web page you are converting.
I do this directly on the Web page, setting up the layout and putting placeholders in where content will go: [Banner], [Global Navigation], [Main Content], [Footer], and so on. Apple has an article on its Developer Connection that provides some examples of simple page maps: developer.apple.com/internet/webcontent/bestwebdev.html. Developing a page map allows you to construct the page, plug in your CSS, and validate without the added noise of content elements. Content will come later. Page maps also have a refreshing way of making you think more clearly about the page - and the site - you are constructing: with only the structure present, page real estate issues come to the forefront.

7. Don't overuse divs and don't overuse classes.
The Apple site, above, also talks about Classitis and Divitis.

8. Look for opportunities to simplify.
Table-based Web pages were a breeding ground for clutter - in code, in design, in navigation, and in little pieces of content lying here and there. WS-based designs tend to make Web design far more streamlined and efficient.

And that is a very, very good thing.

Popular posts from this blog

facebook, time to grow up

Originally published on August 28, 2006 I appreciate how Facebook has enabled me to connect with colleagues, and (younger) family members in a manner that is both informative and expressly cordial. It attracts students like Nutella attracts chocolate lovers, and because of that, I see interesting potential here. In fact, one of our faculty members at Penn State plans to try running his human-computer interaction course through Facebook this fall . Definitely worth pursuing.

the case for incremental redesign: part ii

If you are in any way responsible for a Web site, you should have some understanding of the principles of Extreme Programming . Cultivated as a discipline of software development, it is a combination of ensuring that designs remain uncomplicated, centering changes around user requirements, and employing the concept of the "Whole Team." The result is that small changes are released as they are needed - and endorsed - by the client. Not surprisingly, Extreme Programming speaks well to Web management. Consider its core values: simplicity, communication, feedback, and courage. These are the bedrock incremental redesign. Simplicity - Integrate all site changes in small doses. Avoid tectonic disruption of the entire Web presence. Document faithfully, but do not get bogged down in over-documenting. Or overplanning. Leverage reusable objects. Better yet, get the site into a content management system - one that is scaled to its requirements. Eliminate unmanageable code morass by fol...

how to make the worst of your content management system

I recently heard tell of the following activity, parading as content migration to an enterprise level content management system. I am not making this up: Copy large volumes of Web-content-to-be, page by page, into separate Dreamweaver files containing the design (created and sliced up in FireWorks) Copy/paste said Dreamweaver files into content wells of the content management system Repeat this activity ad infinitum until an entire Web presence is constructed in this fashion always crashing in the same car: recurring mistakes and misuses of the web When I heard this, something inside me snapped. Aside from the stunning inefficiency inherent in creating all these disparate Dreamweaver files, this activity points to a fundamental lack of understanding of what exactly a content managment system is. In the interest of quelling this misunderstanding in others, here follows a list of what not to do with a CMS: Dump a bad Web site into a good CMS. If your organization's Web presence is a ...