Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    Regular Coder cineweekly.com's Avatar
    Join Date
    Aug 2010
    Posts
    485
    Thanks
    14
    Thanked 3 Times in 3 Posts

    How necessary is validating?

    I've read many articles on why it's important but I still am not convinced that it's anything more than coders being too strict. Why is it that I can't find one site without errors, even the most popular sites:

    Site / Validation Errors
    joblo.com 4,504
    google.com 35
    ign.com 889
    artofmanliness.com 68
    codingforums.com 30

    My site only has 30 or so (not the version uploaded) and 90% of those come from the two ads on my pages.
    Last edited by cineweekly.com; 12-16-2010 at 08:53 AM.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,678
    Thanks
    6
    Thanked 1,009 Times in 982 Posts
    OK, yeah, you can get away with errors in your code. But it depends on what kinds of errors you’ve got. If it’s some unencoded entities or a missing alt attribute or stuff like that then there’s no big deal but if you forgot to close an element or nested elements wrongly this could affect the look of your site and the way styling works in different browsers drastically. So you have to use common sense in how many errors you wanna let go through.

    However, I wouldn’t take other bad examples as example to aim for. Take the good ones. The question is not why you should care, it’s why you should not care? Why would you wanna do a bad job if you can do a good one? Why wouldn’t you wanna stand out from the crowd? There’s already too much bad code out there. Why would you wanna add even more bad code?

    The thing is that, for example, many errors come from CMSs that are coded badly, and you as site owner can’t always to anything about it. Some things come from bad user input, e. g. by several people editing the contents without HTML knowledge, just using a WYSIWYG editor. You, as coder, have not much control over a site once it’s released (unless you’re the sole editor maybe), so you can’t always prevent errors. But you can at least do the best job you can do as long as you have control over it. After all, with valid code you can be sure that layout problems come from CSS, not from errors in your HTML.

    And by the way: Google, despite its popularity, is really the worst example you can bring up when it comes to good practices in coding. I’ve lost respect for Google when I found out that they do browser sniffing using the user agent string to serve different content to different devices (and they even did a bad job with this technique).

  • #3
    New Coder
    Join Date
    Dec 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think you always should validate your code, it can prevent many errors. And valid code usually is displayed correctly in different browsers.

  • #4
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Stephan summed it up pretty well. As I have said in other similar threads, most big player sites out there today dont completely validate. But, as already pointed out, this doesnt always mean its bad code. Could be unencoded characters or the like.

    As for me, validation is a means to an end. I WANT cross browser compatibility. I WANT good semantic code. I WANT my site to be completely error free if at all possible.

    Another thing to consider too is if I'm creating a site for a major client, and the site doesnt validate, they may or may not appreciate that fact. They may not even know whether it validates or not, but if they were to see validation errors, it may reflect poorly on me in the future.

    You know home builders can build homes JUST according to code. Does that mean there wont be things wrong with the house once you as a home buyer moves in? Not usually. I've seen too many homes built that were exactly to code, but the builder didnt care whether it was built with quality materials and good workmanship. Nothing worse than a new home owner having a water line start leaking water because the couplings were fitted together with bad glue. lol I know thats a strange analogy, but it rings true.

    I want to code to the very best of my ability, and that means code free from validation errors.

  • #5
    Regular Coder cineweekly.com's Avatar
    Join Date
    Aug 2010
    Posts
    485
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by teedoff View Post
    You know home builders can build homes JUST according to code. Does that mean there wont be things wrong with the house once you as a home buyer moves in? Not usually. I've seen too many homes built that were exactly to code, but the builder didnt care whether it was built with quality materials and good workmanship. Nothing worse than a new home owner having a water line start leaking water because the couplings were fitted together with bad glue. lol I know thats a strange analogy, but it rings true.
    I don't see it as building a house that will fall apart, I just see it as a house whose design may or may not be easily compatible with future trends. "It may be tricky getting newfangled cable internet to my house way out in the country but I'll find a way when there's demand."

    I will validate as sort of a code spell check for closing tags or something but if it's just being picky then I stick with what works. If my site looks great now on the top 5 browsers then that's all that matters to me.

  • #6
    New Coder
    Join Date
    Dec 2010
    Posts
    13
    Thanks
    0
    Thanked 1 Time in 1 Post
    This great number of errors could be typical errors only, like missed "/" in <br/> tags. Validating assures not only correct coding but also good style in coding, accuracy and high standards.

    But I can't believe that sites with huge amount of content can reach 100% validation per page.
    Iflexion website development

  • #7
    Regular Coder
    Join Date
    Oct 2010
    Location
    San Antonio Tx
    Posts
    251
    Thanks
    12
    Thanked 11 Times in 11 Posts
    yupp html changed dramatically over the years it got a lot stricter with the closing tags and some tag sare actually non existant in new versions that doesn't mean its not gonna work anymore it just means its considered bad markup and invalid code, I try to make sure my code is 100% validated to stay caught up with the current html and css even though the old html still works

  • #8
    Regular Coder cineweekly.com's Avatar
    Join Date
    Aug 2010
    Posts
    485
    Thanks
    14
    Thanked 3 Times in 3 Posts
    I guess everyone agrees "If it ain't broke, don't fix it". What we disagree on is the definition of 'broke'.

    To me: If it looks good to most users now, it ain't broke.
    To validators: If it doesn't follow strict W3 trends, it's broke (even if it looks fine).

  • #9
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Again, if its functional and cross browser compliant then yes its fine. If you are having issues though and you have hundreds of validation errors, then how could you expect more.

    I think you can pretty much achieve BOTH. Great looking sites that are both function AND contain valid code. THEN if you have issues, you can say well its not my code, must be IE! lol

  • #10
    Regular Coder cineweekly.com's Avatar
    Join Date
    Aug 2010
    Posts
    485
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Haha, IE... ugh.

  • #11
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    There aren't validation police, but when I create a custom CMS or when I create a theme for an existing CMS, or when I just create a page in general, I take the time up front to make it validate. I think it's a more professional way to do business but the market share that recognizes the difference is very slim.

    For me, it's more a matter of personal satisfaction to ensure all pages are 100% valid (unless a CMS's core functions generate invalid results as is the case sometimes, in which case I just make my code valid). I recognize that all validation errors are not created equal, but I also usually insist that a user on the forum here validates 100% before asking for CSS help. I feel that this is just a matter of good manners. Don't crap all over the floor and then ask me to fix your toilet. In either case I don't mind helping, but I don't want to work around your mess!
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #12
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Haha, love the analogy

    cineweekly.com, check out the link Why validating is good in my signature line. It discusses exactly this issue.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #13
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,678
    Thanks
    6
    Thanked 1,009 Times in 982 Posts
    Well, I’m still wondering: If you write code from scratch, why would you write invalid code in the first place when writing valid code isn’t any harder at all? To me it just doesn’t make any sense to write invalid code and let it be like that.

    However, equally important – if not more – is semantic code. Code that reflects the meaning of the content it’s marking up.

  • #14
    Regular Coder cineweekly.com's Avatar
    Join Date
    Aug 2010
    Posts
    485
    Thanks
    14
    Thanked 3 Times in 3 Posts
    I always write as valid or semantic as I possibly can but I'm always learning and accept the fact that I'll never know everything about html, css, and php. I code in the way I currently know how but sometimes I can achieve the effect I'm going for but apparently there's a better way of doing it that I just don't know yet, which is why it comes out invalid. I'm sure I'm mixing the terms 'semantic' code with 'valid' code but I know I always close tags, alt my images, and make it as clean as I can.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •