Wednesday, September 28, 2005

Standards Compliant Code

What is Standards Compliant Code?

Well, it actuall is more of an overall category than a single thing, however, I'll define it as this:


"Standards Compliant Code is the utilization of the current standards combinations, as set forth by the W3C Recommendations, in order to create code that uses certain standards to ensure that it is readable by the greatest number of people and systems. Essentially, the common feature is to compartmentalize in a way that you keep the code separate from the appearance of a page and (in some cases) from the data displayed on the page."

Now, you'll notice that I said the 'utilization of the current standards combinations' and that is a key point to make. The HTML language is not the only option, there are variations that have come about through the incorporation of XML, and thus the use of XHTML. Also, you can see that I mentioned that the appearance of a page should be kept separate from the page code. That is where the use of CSS will take place.

What is the benefit of following the W3C Standards?

There are many, but I'll highlight some of the most important.

The first thing to consider is that when you write code not following W3C standards your page may look different in different browsers. Yes. There are other browsers besides Internet Explorer, in fact, I personally don't touch IE anymore. I use FireFox as my primary browser and Opera as my alternate. Why would they look different? Well, unfortunately not all browsers interpret poorly written code in the same way. Some are more forgiving than others, so your page may display in a variety of ways.

Another thing to keep in mind is that, without standards compliance, your page may also look different depending on operating system. Yes. There are other operating systems besides Windows. There is a very active group of Linux users in the world, as well as those who use Macintosh, Unix, etc... Again, why would it look different? Many reasons, but one is that different operating systems come with different fonts (for example) and if you use a font in your page that someone doesn't have on their computer to be able to read -- then they won't see it the way you made the page.

Additionally, without standards compliance, your page may look different depending on the screen size of the person viewing your page. Your page should be flexible enough to accomodate a variety of screen sizes, but if its not, it may end up looking far too huge or too small on various screens.

Also, standards compliance often encompases accessibility compliance, though accessibility expands the concept further (including coding and designing your page in a way that will not be difficult for a person with disabilities or physical limitations to still be able to access) -- but I'll be addressing those aspects later.

Overall, there are many reasons why you want to use the standards compliance, and it is to your benefit to learn now, not later, how to do it.

~Nicole

No comments: