in reply to Re: Meditations On HTML In Perl
in thread Meditations On HTML In Perl

What the hell is wrong with using single quotes for html attributes? come on people. Ok, it isn't *quite* valid XHTML/XML, (which i think is stupid..), and if your html is completely valid aside from little errors saying "single quote should be double quote" Then i think you've fufilled everything that xhtml was designed for in the first place. And doing print "<a href='$foo' style='foo:baz' onClick='stuff'>$xxx</a>" is infintely cleaner then doing print "<a href=\\"$foo\\" style=\\"foo:baz\\" onClick=\\"stuff\\">$xxx</a>"..

Replies are listed 'Best First'.
Re^3: Meditations On HTML In Perl
by adrianh (Chancellor) on Dec 05, 2002 at 05:55 UTC
    What the hell is wrong with using single quotes for html attributes?

    Because standards are useful only when they're... well... standard :-)

    And doing print "<a href='$foo' style='foo:baz' onClick='stuff'>$xxx</a>" is infintely cleaner then doing print "<a href=\\"$foo\\" style=\\"foo:baz\\" onClick=\\"stuff\\">$xxx</a>"..

    This is what qq is there for.

    qq!<a href="$foo" style="foo:baz" onClick="stuff">$xxx</a>!
Re(3): Meditations On HTML In Perl
by talexb (Chancellor) on Dec 05, 2002 at 16:13 UTC
      What the hell is wrong with using single quotes for html attributes? come on people. Ok, it isn't *quite* valid XHTML/XML, (which i think is stupid..)

    Well, at the risk of sounding like a stand-up comedian, there's three kinds of people in this world, those who can count, and those who can't .. rimshot

    Thank you, thank you, I'll be here all week, be sure to tip your waitresses, try the veal .. rimshot

    But seriously .. that kind of cavalier approach to standards is a kind of 'black and white' thing for me. Either you conform to the standard or you don't.

    Me, I love it when the HTML Validator tells me a page that I've programmed comes out squeaky clean. But then, back in the 80's I was a C developer who wasn't happy until my code was properly indented, and also compiled and linted cleanly. That's just my style.

    Your style sounds more like 'patch it up, close enough' to me. This is not a personal attack -- I don't know you, so it couldn't be -- it's just an observation that you and I appear to have differing standards in quality.

    --t. alex
    but my friends call me T.
Re^3: Meditations On HTML In Perl
by Aristotle (Chancellor) on Dec 08, 2002 at 13:47 UTC
    Tolerance for that "hey, it's close enough now ain't it" attitude is the reason the web is nowadays comprised by 99% invalid HTML, which requires parsers be written with extra intelligence and makes it hard to programmatically extract information from remote pages. Not every kind of laziness is a virtue.

    Makeshifts last the longest.