The internet today is still surprisingly young and it’s growing at a massive rate. There are some fantastic websites on the internet but a large proportion of them still don’t pay attention to the standards sites should be living up to.
There are a few reasons why you should try to code to the highest possible standard. The cleaner, tidier and more valid your code, the more search engine friendly and accessible your website will be.
So what are the best ways to make sure your website is up to scratch? First of all, as touched upon above, make sure your code validates. The easiest way to do this is visit http://validator.w3.org and see how many errors or warnings you get. Some errors may be small, such as having images without an alternate (alt) tag. These are some of the errors you can easily get rid of and will make your website more accessible for someone who, for example, is hard-of-sight and may be navigating your website using a screen reader, which can’t process images. Having an alt tag on your image means the screen reader can process this and tell the person what the image is about.
Another point to bear in mind is the speed of your website. If your code is buggy and full of errors, it’s going to have an effect on the speed of your web browser and may take longer to process the code. Even if your code is valid, semantically it might not be correct – for example, you may start wrapping lots of elements in div tags and end up with a case of far too many divs that you don’t actually need. Even if the difference is minute, by removing unnecessary code it’s still an improvement.
The key points to remember are that you should write code that is as clean as possible. Plan the website build from the very beginning and see what you can use, re-use and make sure you know how your website will be structured from the start. This way, you can be sure you know what element is needed where and what you need to do to code it in a lean and efficient way. Also, keep checking to make sure your website is valid (through the validity checker) and soon you’ll be in the habit of picking up on what may cause a problem and naturally start coding to avoid the error itself.