Re: Why HTML should be taught as HTML without pretending it is XML

On Jul 18, 2007, at 12:29, Lachlan Hunt wrote:

> I think there could be a number of issues that such a document  
> could address, with numerous benefits:
>
> * How to convert from XHTML to HTML and back again, dealing with  
> issues
>   like:

These aren't guidelines for Pro Web authors. These are statements of  
consequences of the spec for converter writers.

>   - <?xml encoding=""?> to <meta charset="">

As an aside, I my opinion, taking the time to develop a serializer  
that generates bytes in a legacy (i.e. non-UTF-8) encodings is a  
waste of time, since UTF-8 always works for consuming software (and  
someone who as a consuming human can't deal a UTF-8-encoded file is  
not a Pro Web author ;-). I think converters should just output UTF-8  
and label that correctly instead of trying to preserve the legacy  
encoding of the input.

> * Guidelines for pretty printers (like HTML Tidy)

Doing pretty-printing so that it is pretty but doesn't break stuff is  
quite a can of worms. It might be a good idea to document the  
pitfalls. However, since some of the consideration are contrary to  
each other and the "right" approach depends on what the user is  
trying to achieve, I think one way of pretty-printing should not be  
made normative.

> * Coding conventions for authors
>   - Quoting attribute values with ""
...
> I think the authoring guidelines should be given the least weight,  
> since they have little technical impact and will be the greatest  
> source of conflicts in personal opinions.

To illustrate the point, I disagree with a coding convention  
requiring double quotes (really--not just for the sake of argument).  
On common keyboards, typing ' is more ergonomic than typing ". I  
think it would be irresponsible to ask people to do something that is  
less ergonomic for the sake of aesthetics. (OTOH, using " makes  
perfect sense in serializers that want to have the smallest number of  
special cases and want to target IE.)

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Wednesday, 18 July 2007 10:07:00 UTC