Re:How a new HTML element will make the Web faster
by iopq on Tuesday September 02, 2014 @05:52AM
(#8256664)
this is why attributes are really a stupid ass way to do things
[ Parent
| on HN ]
Re:How a new HTML element will make the Web faster
by aubergene on Tuesday September 02, 2014 @11:19AM
(#8258043)
That isn't well formed, you're missing two </src>.
I dislike XML, the confusion between attributes and sub elements is one of the worst bits.
Re:How a new HTML element will make the Web faster
by ianburrell on Tuesday September 02, 2014 @01:19PM
(#8258848)
"1024 large-image.jpg 512 small-image.jpg image.jpg fallback My Image"
That is what your code would look like to browsers that didn't know about the new elements. HTML is defined such that browsers can ignore unknown elements for compatibility and still display the text. Using contents for the metadata means that browsers need to know about the elements to at least hide the text.
Re:How a new HTML element will make the Web faster
by Pxtl on Tuesday September 02, 2014 @10:17AM
(#8257679)
Holy crap that's verbose.
This is why *ML is a stupid-ass way to do things. "the problem it solves is not hard, and it does not solve the problem well."
Re:How a new HTML element will make the Web faster
by mercurial on Tuesday September 02, 2014 @07:49AM
(#8257008)
"Attributes are stupid" is also Maven's approach, but this results in unnecessarily verbose XML files.
Re:How a new HTML element will make the Web faster
by est on Tuesday September 02, 2014 @09:27AM
(#8257367)
<imgset w1024="large.jpg" w640="medium.jpg" />
Re:How a new HTML element will make the Web faster
by palakchokshi on Tuesday September 02, 2014 @01:01PM
(#8258751)
not practical since you'd have to define attributes for every conceivable size in the spec and that's just asking for trouble. e.g. w2048, h1024, w320, w240,h320, wPleaseShootMe :)
Re:How a new HTML element will make the Web faster
by hrktb on Tuesday September 02, 2014 @06:29AM
(#8256794)
But now it's a PITA properly handle and escape for any toolset that don't have good xml support. Imagine people starting to put <![CDATA[ ]] blocks into this.
Re:How a new HTML element will make the Web faster
by iopq on Tuesday September 02, 2014 @07:01AM
(#8256876)
I meant if I had designed it from the start. Then everything is a tag, no attributes, no quotes, equal signs, etc.
Re:How a new HTML element will make the Web faster
by johnlbevan2 on Tuesday September 02, 2014 @08:21AM
(#8257107)
How about JsonML; i.e. XHTML but in JSON format to make it less verbose / further improve integration with javascript?
Re:How a new HTML element will make the Web faster
by mckamey on Wednesday September 03, 2014 @01:20PM
(#8264127)
JsonML is pretty efficient when auto-generated from HTML source. I use it as an intermediate form for client side templates ( http://duelengine.org ) but I don't write it by hand. Its regularity makes it a perfect candidate for output from a parser/compiler.
Re:How a new HTML element will make the Web faster
by yoklov on Tuesday September 02, 2014 @05:20PM
(#8260229)
You'd want to kill yourself pretty quickly.
JSON is great as an interchange format, but there are many reasons editing it by hand is painful, lack of comments and lack of newlines in strings not being the least of them.
Re:How a new HTML element will make the Web faster
by aubergene on Tuesday September 02, 2014 @11:21AM
(#8258056)
There's no syntactic difference between an attribute, an object and an array.
Re:How a new HTML element will make the Web faster
by iopq on Monday September 08, 2014 @07:53AM
(#8284274)
you can't nest tags into attributes
Re:How a new HTML element will make the Web faster
by tobyhinloopen on Tuesday September 02, 2014 @06:00AM
(#8256695)
I really dislike your approach.