IMARKETING20BLOG

iMarketing 2.0

Tags >> code compliance
Apr 28
2010

The Importance of Clean and Valid Code

Posted by Aqua Blue Marketing in code compliance

Coming from a development background, I can attest to the fact that, in general, developers have their own methodologies and do not like to be forced to do things in ways that are not their own. However, when it comes to creating or editing a website, there are certain requirements that you should insist your developer meet.

Although good content is the greatest contributing factor to your website's SEO, there are a number of coding strategies which can also help with your SEO, as I touched on in my last post "Accessibility for Your Users (and Search Engines!)". Valid code is very important to search engines because of the way they parse content. Search engines give greater consideration to well-formatted, standards-compliant websites, since they can understand them more easily. To see whether your site has valid code, run it through the W3 Validator. One or two validation errors generally won't hurt your site and are many times unavoidable, but many websites have hundreds of errors. Some examples of these errors include unclosed, deprecated, or missing tags, among hundreds of others.

Apart from its SEO impacts, valid code also helps prevent breakage (your site not displaying or functioning properly), especially across browsers. When a browser displays a website with invalid code, it has the option to display that site as it chooses, and many browsers display these sites in different ways. This is why some sites look differently in Internet Explorer than in Firefox, Chrome, or Safari. Even after ensuring that a website meets code validation, your developer should still test your site in every browser which your visitors may use.

Going along with standards compliance is code readability and maintainability. Just as your website should be displayed to your visitor in an understandable way, the code should be written in an understandable way. This means having your developer put logical sections of your website into logical sections of code, using whitespace (newlines and tabs) for readability, and documenting any pieces of code which may be hard to understand. This will save you both time and money when you need to make a change to your site, and will make for a more seamless transition should you need to hire a new developer to work with the existing code.

Of course, since content management systems modularize code for even greater maintainability, the code that gets sent to the browser is, usually, not as readable as the original code. This is because it must be aggregated by the CMS first, but this is not a problem. Another great feature of some content management systems is that they will sanitize code - that is, if invalid code is entered, the CMS will automatically fix it to meet web standards (this feature can usually be turned off if necessary).

Blog Tags

@AquaBlueWeb

Not found