Best practices are not necessarily required in order to validate a page as standards compliant, however they just as important (and in some cases even more important).
A short list of best practices for layout that all web designers worth their salt strive to adhere to:
- Keep content, styling and functionality as separate as possible: This means using no inline styles and no inline javascript, it also means using external CSS style sheets and external javascript files. When server side scripting is required code should be defined in external functions that are inserted in the html in their simplified form. These are essentially MVC principles.
- Don’t use tables for layout: I won’t go into this here, but I have an article on why you should use CSS rather than tables if you’re interested. Tables are for tabular data, not for the main structure of web pages.
- Don’t use depreciated tags: This goes along with the first point on the list. <font> tags are unnecessary, and will only get in the way. CSS has everything you need to style a page.
- Keep your code clean, consistent, and comment regularly: I don’t think this requires much explanation, but proper commenting is often overlooked the rush to meet a deadline. As far as constancy goes, what I am referring to here is sticking to some form of coding conventions. It is far better to have a pattern to your madness, especially when you are trying to figure out what you did six months later.
- Don’t misuse flash: Flash should be used as little as possible in web pages, and should never be used for the whole website (See this article: Flash based websites: are they really that bad?).
This is not the end all list of best practices, but if you will avoid the majority of web design pitfalls if you follow them.
Poster un nouveau commentaire