SoftwareAnd by software, I primarily mean WYSIWYGs. This also includes those great text editors that offer incorrect HTML syntax guidance. And there are some that are self-described visual editors, or are really page layout applications, or even word processors. But ultimately, if it writes HTML for you, I'm talking about it. I don't want to name any in particular, however, since I know people can be defensive about the tools they use. Some are bad, and some are good, and some are only as good as the user is bad.I am, however, going to offer this statement from a company who makes all sorts of web tools. This statement was reported at a few places, including a review of the Web Standards Project Panel posted by Macromedia (don't worry, there are other sources to verify it):
Granted, this doesn't necessarily apply to some tools that only output to HTML as an ancillary function. But if they choose to market this feature and know developers rely on it (like creating entire sites from sliced images), then they should have the responsibility of building the tool to write correct code. Some tools offer the option to customize code by, for instance, letting you quote attributes. This should not be an option, attributes should be quoted. If somebody really wants to write non-compliant code, that person can edit it manually, but the tool should default to correct code at all times, and assume the user utilizes the tool because the user cannot or will not code by hand.Wouldn't it be nice if the editor, or other non-dedicated tool (page layout tool, for instance), could notify the developer when he/she is creating inaccessible code? Wouldn't it be nice if all those positioned <div>s were re-ordered, with prompting to the user, so that a screen reader could make sense of the content when linearized? Maybe it could coach the user for page titles instead of leaving blank <title>s everywhere. Perhaps it could tell the user that "click here" is an unacceptable string of text to make into a hyperlink. How about warning when a frame has no navigation in it? Image maps without text links? Lack of meta information? And the list goes on.There are too many people who've been pushed into web development as part of their daily job, but have no idea what HTML is. I've seen too many human resource staffers expected to maintain the job posting section of a site. Why not provide them with a tool that does it right? They aren't going to learn HTML, or even know about the WaSP campaign, so let's target the software manufacturers who are the de facto authors of millions of invalid pages. Let the users create good code, despite themselves.So I say to the tool developers, use your software to guide the user with correct code, validate all output, and cut out all that evil. For all the tool users, you must understand that the tool limits you. Unless you hand tweak the ouput (in which case I refer you to the next section of this piece), you can only generate what the tool will let you generate.
- The W3C HTML/XHTML validator. This will validate the given page against the DTD listed within the page. The source code is distributed under a GPL-compatible license.
- The W3C CSS validator. Another tool that could be integrated into an editor.
- HTML Tidy. A handy stand-alone utility that searches for, and corrects, tag errors (nesting, unclosed tags, illegal tags, etc.). The source code is there, and they promote integration with other tools.
"You are correct about the sample of code shown, but it was done deliberately. It was meant to show a typical sample of HTML, whether or not that correctly conformed to standards. I agree that, in itself this isn't really an excuse for writing 'bad code', but it wasn't sloppyness. [...] For myself I just hadn't really been aware of XHTML and it's importance - a pretty poor excuse I think you'll agree."To his credit, the author was aware of the importance of standards by the time I had found this book, and had made significant improvements in later books. But certainly this is indicative of an overall lack of strict standards compliance in the very "text books" so many developers use. And since those developers often don't know about, or won't take the time to visit, the W3C site, they are at a significant disadvantage.So I say to the people who code, learn the standards, code to compliance, and always keep the user in mind, regardless of what unfortunate browser he or she might use.