E-mail List Archives

Re: Well formed verses Valid code

for

From: Roberto Modica
Date: Feb 27, 2007 2:40PM


I believe that validating code is our first step to any sort of quality
assurance that we have when developing websites. From an accessibility
point of view I feel that it is important that new and old developers
validate there code as the starting point of accessibility, ensuring that no
invalid mark-up has any chance of affecting accessibility in any way. The
process is simple and should be part of any developers' workflow, and I
don't believe that validating your pages add significant amount of time to
the development process and should be carried out. If someone is using a
'non-conventional' browser then the potential is there for non-compliance if
validation fails, if we are in control of that then it is something we
should do.

Rob

-----Original Message-----
From: <EMAIL REMOVED>
[mailto: <EMAIL REMOVED> ]On Behalf Of John Foliot -
Stanford Online Accessibility Program
Sent: 27 February 2007 18:19
To: 'WebAIM Discussion List'
Subject: Re: [WebAIM] Well formed verses Valid code

Alastair Campbell wrote:

...a response I totally agree with. He said:

>
> We use valid code to be sure that various user agents render the
> content as expected. (Of course they don't in practice, but at least
> then we know it's a bug of that user agent and therefore their
> responsibility.)

(Pure petrol/gasoline vs. flawed autos)

>
> Since each of these assistive technologies could render non-valid
> code differently, the best thing you can do within a reasonable
> effort is ensure that you use valid code, and check common user
> agents.

I might also add that in the subjective realm of applying the WCAG against
your content (What *is* an appropriate ALT text? - we believe we know what
is *not* appropriate, but everything else is opinion; what is "blink"
exactly?) ensuring valid code is a binary check - it's valid or it's not.
When instructing or teaching new students to the concepts of accessible web
development, it's nice to have a solid foundation to build upon, and that
foundation is code standards.

Andrew, this is not a criticism aimed at or to you, but I am at a total loss
as to why so many developers dismiss valid (x)HTML as a non-issue, or not
critical to the accessible development process. Andrew may be right that in
practical terms, many pages that do not validate are still accessible to
mainstream users as well as the majority of users of AT. Does this then
make it right? I argue no - if it fails one person due to "bad code", then
we as developers have failed.

Setting valid code as a requirement for "accessibility" establishes the fact
that developers must take care, must think through what they are doing, and
must not rely on hacks, cheats, and trickery to appease one browser or the
other - a situation that is not as prevalent as it was 5 years ago, but
still persists. Forgiving large CMSes and other large-scale
platforms/developments for what should be trivial things to fix in essence
says "Do your best, but don't worry too much, it's not really that
important" - and if getting a basic markup language syntax correct is not
that important, why should other arcane requirements such as providing a
long description, or captioning to videos be any more important - hey.. They
tried their best, but Oops... Sorry. It's a mind set thing.

To the seasoned veterans of this list (and others) who have been banging
away at this for years, Andrew's points can have some credence - I simply
worry that the message it sends to the uninitiated or newer developers who
are beginning this journey may be confusing. Validation is simple, and
keeping things simple for beginners is not a bad thing - once you can
produce valid code all the time, every time, regardless of whether the pages
are hand coded in notepad, or churned out by a CMS, blogging tool or other
means, then you can relax your requirements slightly. Once you understand
the "rules", then when you break a rule, you know a) that you have, b) you
know why, and c) you have a good idea of the potential for problems it may
or may not be creating. But before you get there, striving for and
attaining code validation is a good start. I know that Andrew does not
disagree with the need/desire for valid code - that's not what he has said.
But I think that de-linking code validation from accessible web development
is the edge or a slippery slope, it in effect says that standards can be
secondary to results - a point that flies in the face of logic to me.

>
> It may be that an ampersand in an href is not going to affect any
> known user agent, but if you're going to provide a guide for
> developers, I'd keep it simple: use valid code.

EXCEPT... Earlier in this thread my good friend Derek Featherstone pointed
out a situation (rare, but real) where a fouled ampersand *DID* negatively
affect the outcome (http://webaim.org/discussion/mail_message.php?id=10177).

> I have been in
> situations where developers were reluctant to use valid code because
> it meant changing their CMS, so I don't think it will necessarily be
> caught by other parts of the process.

And see, that's the point. If they are reluctant to something as basic as
code validation, and it is accepted that this is OK, then what happens when
they must do something else in the name of accessibility?

JF