Aug 25, 20109

How and Why Would Anyone Validate Their Code

Validating HTML or CSS code is a controversial topic. Many are strict on assuring their code is validated while others do not care at all. There are plethoras of reasons why you should validate your code, or at least as much as possible instead of ignoring the errors. We discuss several benefits to validating your HTML and or CSS.

Decrease Cross-Browser and Cross-Platform Issues

There are many reasons why some browsers interpret your code differently from others. While it could be an intended implementation in the browser, it is mainly a bug in its interpreter that causes variant changes to your web page across many different browsers and platforms.

You can implement many quick fixes and “hacks” to your code to get it to look just right in most of the popular browsers. However, as these browsers continue to be updated, one of your hacks or quick fixes may have been a temporary work around to a bug in the browser, which may be fixed in the future causing your site to look awkward after an update has been implemented.

Moreover, while some workarounds are necessary, you can try to eliminate several by just validating most or all of your code, possibly making your website future proof.

Good Development Practices

Assuring your code is completely valid benefits you as a developer as you will help teach yourself good development practices for the future. Additionally, when learning or developing, it is best to learn and develop something the right way instead of keeping bad habits in your learning and developing process.

Professionalism

Validated code is a big sign of professionalism especially to your current or future employer and or clientele. By having valid code, it shows whomever it may be that you take your time to develop something of quality rather than something that seems like you whipped up quickly to get the job done.

As an additional to professionalism being valid code, organized and well laid code is also a sign of quality and professionalism. Thus, always assure your code is neatly organized and valid when need-be.

Standards Compliant Code

Browsers today are always improving to be standards compliant, so your website should too. When you validate your code, it means that your code is standard compliant. With that said, it is definitely a great idea to future-proof your website by validating your code, which generally takes minutes to do.

How to Validate

Now that we covered several benefits to validating your code, how do you validate code?

One of the easiest ways to validating your code is to visit w3.org and use the HTML and CSS validators available there. All you need to do to check if your code is valid, is to either upload, paste, or link your code or website and hit the validate button. If errors return, they usually provide explanations to each error returned, making it generally easy for you to follow through and fix.

Other ways to validate your code is to utilize tools available to make validating code a lot easier. These tools are generally available in a plethora of options such as validators built into Integrated Development Environments, browser toolbars, online services, or even desktop tools.

Overall, validating your code is a definite must whether you do it today or tomorrow. In fact, as time progresses and browsers continue to update to become more standards compliant, not validating your code will mean that your website will not properly be laid out as you may have intended throughout these browsers.

Furthermore, prepare your websites for tomorrow and get the code validated as it will save you time in the future, and your website will more likely work across different browsers and platforms than it would be without being validated.

9 Comments

  • Web Designer Tom
    Aug 25, 2010
    I have always validated my code, but a lot of people do not see the value in it. I do not agree with validated code is improves Cross-Browser issues as the issue is the way the browser render the web files, Firefox displays what the code tells it to and if a mistake is made then the website doesn’t work or is missing elements. IE tends to guess what the code should be and try fix the wrong code.

    Its good practice to use validated code for accessibility and general good looking working code.

    I think if all search engines joined forces to sort out the issues that there rendering engines cause then people would learn to code correctly and get it validated.

  • CodeMyConcept
    Aug 25, 2010
    Awesome post!

    People sometimes have the tendency to overlook code validation and I personally believe that it is just as important as regular functionality and aesthetics.

    We validate every single website we work on, we feel is part of providing our clients with high quality work.

  • DesignMango
    Aug 25, 2010
    I personally always validate my code, I think it is just habit.
  • Thomas Traub
    Aug 25, 2010
    I always validate my page using http://validator.w3.org/ out of the web developer extension for FireFox, I used to validate the CSS, too, but since I am using more and more CSS 3 and the validator insists on 2.1 I ceased using it.

    It’s one of the bases of my work flow. Further I use http://www.javascriptlint.com/online_lint.php and http://dean.edwards.name/packer/ for my Javascript.

    Why ? There’s no reason not to do it and it assures me that any issue in browsers do not origin in malformed code.

  • Danillson
    Aug 26, 2010
    I also believe that code validation is important.
    Where can I find these delicious looking browser icons?
  • Tomsa
    Aug 26, 2010
    Valid code is a good thing to avoid surprises :)
  • Priyesh
    Aug 26, 2010
    Great Article! Having valid code is not a requirement for some but I feel having valid code shows a great sense of professionalism. I agree with some of the other posts that having valid code reduces any unwanted surprises when it comes to browser compatibility issues.
  • adhi
    Aug 29, 2010
    right, valid code can make new challenge
  • Truong
    Sep 2, 2010
    i always using valid code,because it is very good for web

Leave a Comment

Ask a Question on Design Reviver Answers