:: [DNG] HTML/SVG/PostScript [was: ...…
Pàgina inicial
Delete this message
Reply to this message
Autor: Didier Kryn
Data:  
A: dng
Assumptes vells: Re: [DNG] I'd like to hear more about the Xaw widget set
Assumpte: [DNG] HTML/SVG/PostScript [was: ...more about the Xaw widget set]
Le 02/01/2025 à 07:09, Steve Litt a écrit :
> Didier Kryn said on Wed, 1 Jan 2025 15:55:36 +0100
>
>>      Why do you consider HTML a mess? I find it rather usefull.
>>
> My answer to your question is: "Because most people don't use HTML5
> like you and I do."
>
> Before uploading an HTML file, I make sure that:
>
> 1. It's HTML5
>
> 2. It's well formed XML
>
> 3. It passes W3C validations with no errors or warnings
>
>  From talking with you in the past, I deduce you do the same.
>
> #1 is obvious. It has the most useful features, and it allows (but
>     unfortunately doesn't require) end tags.
>
> #2 is like using extra parentheses languages like C or in math
>     equations so you don't have to remember exact rules of precedence,
>     and the maintainers who follow you don't either. Those end tags
>     triple the likelihood that your HTML5 technically expresses what you
>     wanted it to. End tag use also gives you an excellent debugging
>     methodology that, if desired, I can reveal in a separate thread.


    Please reveal, at least privately.

> #3 is vital because most mainstream browsers render valid HTML5
>     correctly and reasonably uniformly. The so-called "trouble with
>     HTML" happens when all these fools upload (or manufacture on the
>     fly) invalid HTML, with undefined situations, and each browser is
>     left with the task of guessing what the author really meant.
>
> So the real "trouble with HTML" is the same as Perl's problems: "Many
> ways to do it". In the hands of an extremely competent practitioner,
> "many ways to do it" might occasionally be convenient, but in practice,
> with so many poser programmers, it just creates an unmaintainable mess.
>
> In an ideal world, the web would have run on an XML dialect instead of
> HTML. There were even attempts to retrofit XML (xhtml). The problem is
> that HTML was invented first, and by the time XML came along, the genie
> was long out of the bottle and to force XML on people would have broken
> hundreds of thousands of websites. They tried to nudge all new
> construction to xhtml, but it was too little too late. So now at least
> HTML5 *allows* XML well formedness.


    Well, Steve, I'm not as carefull as you, but Emacs has HTML and SVG
modes with color and indentation, and they warn you for unclosed tags.
BTW the SVG mode allows to toggle between the source and the graphical
view, which is just great because it allows you to see the effect of
your changes in 2 keystrokes.

    Remark: in HTML nobody wants <br></br> or <hr></hr>. HTML lacks the
<br/> and <hr/> form for such tags, like in SVG.

    For people not using HTML5: there is at least one reason: the first
line is

    <!DOCTYPE HTML> instead of

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http:www.w3.org/TR/REC-html40/strict.dtd">

    which nobody can remember.

   Sure, HTML5 has a richer API than HTML4. Maybe this is a
complication for the browsers, but not for the designers of web
interfaces: just use what you need and know. I don't use DOM, nor any
kind of script and most probably won't ever use the <canvas> (which I
wouldn't have noticed the existence of, without you Bruce.)

    Its fun to design SVG with the text editor because it exercises
one's skills in math and mental calculus. Same for PostScript, though
more difficult I think. I have also written animated SVG for the fun,
not to put in a web interface; use with caution because it can be very
cpu-intensive and overheat your computer.

--     Didier