AvoidNeedlessComplexity

From W3C Wiki
Jump to: navigation, search

Avoid Needless Complexity

Intent

Motivation(Forces)

Evidence

Applicability

Consequences

Known Uses

Examples

Doctypes

Although it is common practice for authors to include a doctype declaration at the top of a HTML document, browsers don't actually parse the referenced DTD. Doctype declarations are long and complex and generally authors have a hard time remembering how to write them out in full. An example of a typical doctype for XHTML 1.0 strict:

`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">`

So, instead of having users write a full doctype declaration they could simply write something like:

`<!DOCTYPE HTML>`

That declaration is easy to remember and serves the purpose of triggering standards-compliance mode in browsers.

Also Known As