Re: Let's use XHTML and XmlTextWriter



On Tue, 2004-02-17 at 03:45, Nat Friedman wrote:
> On Mon, 2004-02-16 at 20:51, Edd Dumbill wrote:
> > I'm glad to see it, but it's not entirely perfect.  It won't do good
> > things if there's a "&" character in the subject, for instance.  Also I
> > reckon that it's the responsibility of the engine to do the two line
> > breaks after, not the renderer itself.
> 
> Other than auto-escaping, how exactly does this make our life easier?

Immediately, it means that one renderer won't go on to upset another by
inadvertently mismatching tags and causing rendering bugs, e.g. turning
the rest of Dashboard italic through forgetting an </i>.

> One of the advantages we appear to lose if we move to XHTML -- and
> particularly to using XmlTextWriter -- is that right now people who are
> beginning programmers but have some HTML and design skill can easily
> write and tweak renderers.

Actually, it's mostly experienced programmers who write poor HTML. 
Anyone coming from a modern web design angle will want to know why they
can't use XHTML Strict and CSS these days, because that's the
acknowledged best practice there.  A glance through the articles at the
well-respected web design site A List Apart <http://www.alistapart.com/>
reveals as much.  We can't go that far, because GtkHTML 3.0 doesn't do
CSS.

We should care about the HTML we use for the same reasons we produce and
adhere to coding standards: it makes it easier to work with others, it's
clearer to see when things are going wrong, and it promotes the future
longevity of our code.

To address your other point, I think it's a bit of a strawman argument
about beginning programmers with some design expertise, unless you have
some particular individuals in mind.  It's at least as scary to do CVS
checkouts, make diffs and submit patches as it is to learn 3 or 4 API
calls.  It's at least as hairy to remember to backslash everything
properly and call the correct escaping functions as it is to get your
head round WriteStartElement and WriteAttributeString.

If the long-term participation of those with design but little
programming expertise is wanted, and their ability to directly change
the code base is required, then the project ought to do as others do,
both in GNOME and on the web, and use some kind of templating language
(like Glade is for GNOME, or ASP.NET for web).

Alternatively, but unrealistically for now, if we had decent CSS
support, then designers would be able to alter CSS files and
significantly tweak designs without impacting the actual code at all. 
The much-celebrated http://www.csszengarden.com/ shows the flexibility
of that approach.

> Enlighten me. :-)

I hope I've gone some way to outlining my reasoning.  From my point of
view, it's simply best practice that leads to more maintainable code and
fewer bugs.  However, I've a long history with web standards and that
makes me have strong opinions on it.

-- Edd





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]