Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I think the most frequent gripe I hear about Web Components is that they look like XML and that totally freaks people out. I can definitely imagine my own horror if I were to open up a client project and top to bottom was all custom elements that I knew nothing about.
My own opinion is that they're almost like jQuery plugins. I don't see much difference in:
<div class="fancy-dropdown"></div>
$('.fancy-dropdown').dropdown();
and
<fancy-dropdown></fancy-dropdown>
and just like jQuery plugins, they're great if used in moderation but horrible if they constitute the bulk of your site. I realize that's not a very accurate analogy but I think it gets at my main point which is "If it does something mysterious then don't overuse it."
I figure in time some custom elements might become so commonplace that they achieve the same level of mindshare as seeing $ or .btn does today. Bootstrap is a good example. If I opened a document and saw <twbs-btn> then I could say "Oh! I know how Bootstrap buttons work. OK, moving on...". So my hope is that the good stuff will rise to the top and the best practice will be "liberally use the good stuff, but go easy on the esoteric or lesser known elements."
Does that make sense? What do you guys think?
I think the most frequent gripe I hear about Web Components is that they look like XML and that totally freaks people out. I can definitely imagine my own horror if I were to open up a client project and top to bottom was all custom elements that I knew nothing about.
My own opinion is that they're almost like jQuery plugins. I don't see much difference in:
<div class="fancy-dropdown"></div>
$('.fancy-dropdown').dropdown();
and
<fancy-dropdown></fancy-dropdown>
and just like jQuery plugins, they're great if used in moderation but horrible if they constitute the bulk of your site. I realize that's not a very accurate analogy but I think it gets at my main point which is "If it does something mysterious then don't overuse it."
I figure in time some custom elements might become so commonplace that they achieve the same level of mindshare as seeing $ or .btn does today. Bootstrap is a good example. If I opened a document and saw <twbs-btn> then I could say "Oh! I know how Bootstrap buttons work. OK, moving on...". So my hope is that the good stuff will rise to the top and the best practice will be "liberally use the good stuff, but go easy on the esoteric or lesser known elements."
Does that make sense? What do you guys think?
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
My personal disdain of XML has nothing to do with its similarity to HTML, in fact I rather like XHTML and knowing that a tag is properly closed. Kind of wish we could have <script /> tags when the trailing </script> isn't necessary (eg embedding).My personal disdain of XML is in its use with SOAP and the wire Bloat that was un-necessary even at the time it was thought of.
Then you take and add to it things like Microsofts implementation and helpers with .NET (and to some extent Java as well) and how now every "IT Guru" (at least at the Global Enterprise Level) seems to think this is the only way to do it. I can't wait till the rest of the world figures out that JSON is lighter, Minimal Schema Design is more flexible, and having 100 element types is confusing.
I understand why the "it's like XML" complaint arises. Superficially, it looks a bit like XML:- The element names are "namespaced" with x- polymer-, etc. This looks a bit like an XML namespace.- The element names are either from a bespoke ontology defined by the author or (increasingly) some defacto standard one (libraries, in the case of Web Components.) But not ones the reader is necessarily familiar with.- The elements have close tags. Like XML. Modern HTML practice is not to write markup, but to write instructions to the parser, for example:<!DOCTYPE html><div>Hello, world! ...Is really shorthand for "instructions": I'm using HTML 5, create document element, create head, append head, create title, append title, pop, pop, create body, append body, create div, append div, create text node, append text node, pop, pop, pop. Custom Elements take you away from this world a little bit, because the parser groks you less.I think programmers dislike XML for a variety of reasons. It would be a useful exercise to elicit what these reasons are, and see which ones apply to Web Components. Then you can walk people through it.Here's a rough first cut:XML Namespaces:XML namespaces suck because you have two extra values/parameters (the prefix and namespace URI) you have to keep track of everywhere. If you get it wrong you get empty result sets, malformed documents, or lots of xmlns spew from different parts of the document having different prefixes. You can't understand part of a document with reference to some xmlns declaration a thousand lines away. When you edit documents you have to trim xmlns declarations elsewhere.
Web Components are much simpler: they always have one name. The prefix is part of the name. A specific element can't appear in two places with different prefixes; there's no namespace URI. There's no declaration of the prefix anywhere.
Plethora of tag names/I don't know what these tags mean:XML documents are "hard" because I don't know what all of these tags mean.
XML is used for all kinds of random domains; Web Components are mostly used for UI widgets. So the tag names should be a bit easier to understand. [I think we could have a stronger answer to this. XML would refer you to schema, but schema is confusing. It would be nice if we had a practice of being able to say FooButton.documentation() or something and jump into documentation.]
I have to be careful or I get invalid markup:XML processors are often strict and spew lots of errors at you if you forget to close a tag. As a result, you see nothing/no output/scary errors.
The HTML parser muddles through. As a result you get documents with a structure you didn't expect, but you do see something; use the inspector to debug. [I'm not sure if this is a better or worse situation.]
Am Dienstag, 22. Oktober 2013 03:48:51 UTC+2 schrieb Dominic Cooney:I understand why the "it's like XML" complaint arises. Superficially, it looks a bit like XML:- The element names are "namespaced" with x- polymer-, etc. This looks a bit like an XML namespace.- The element names are either from a bespoke ontology defined by the author or (increasingly) some defacto standard one (libraries, in the case of Web Components.) But not ones the reader is necessarily familiar with.- The elements have close tags. Like XML. Modern HTML practice is not to write markup, but to write instructions to the parser, for example:<!DOCTYPE html><div>Hello, world! ...Is really shorthand for "instructions": I'm using HTML 5, create document element, create head, append head, create title, append title, pop, pop, create body, append body, create div, append div, create text node, append text node, pop, pop, pop. Custom Elements take you away from this world a little bit, because the parser groks you less.I think programmers dislike XML for a variety of reasons. It would be a useful exercise to elicit what these reasons are, and see which ones apply to Web Components. Then you can walk people through it.Here's a rough first cut:XML Namespaces:XML namespaces suck because you have two extra values/parameters (the prefix and namespace URI) you have to keep track of everywhere. If you get it wrong you get empty result sets, malformed documents, or lots of xmlns spew from different parts of the document having different prefixes. You can't understand part of a document with reference to some xmlns declaration a thousand lines away. When you edit documents you have to trim xmlns declarations elsewhere.
Sorry if that's off-topic now... XML namespaces are neither elegant nor easy to handle all the time. Big BUT - in the world of complex compound documents and XML encoded data they play a important role and unfortunately nobody has come up with something easier or more elegant. But there are XML languages which simply wouldn't work without them. Aeronautical Information Exchange Model (AIXM) is used to encode all information needed to deal with air traffic - you certainly don't want to allow any ambiguity here.Web Components are much simpler: they always have one name. The prefix is part of the name. A specific element can't appear in two places with different prefixes; there's no namespace URI. There's no declaration of the prefix anywhere.Right - because they are simply part of HTML - so no mixing of namespaces. However we'll see if this will hold in the long run when dozens of e.g. layout components from different origins pop up and name clashes become more likely. One day we probably need an answer to this or live with clashes.
Plethora of tag names/I don't know what these tags mean:XML documents are "hard" because I don't know what all of these tags mean.Well, also a matter of good or bad design. Decently designed XML is quite readable without much explanation while of course you can produce the complete opposite but that's true for any code - good variable names and well-structured code makes it readable and extensible while you can write absolutely horrible code in any language.XML is used for all kinds of random domains; Web Components are mostly used for UI widgets. So the tag names should be a bit easier to understand. [I think we could have a stronger answer to this. XML would refer you to schema, but schema is confusing. It would be nice if we had a practice of being able to say FooButton.documentation() or something and jump into documentation.]I'm not sure if i would limit web components to ui components. There are already example of non-UI components (localstorage, ajax ...) in Polymer.
I have to be careful or I get invalid markup:XML processors are often strict and spew lots of errors at you if you forget to close a tag. As a result, you see nothing/no output/scary errors.Well, same can be said e.g. for CSS ;) Syntax errors can scramble your whole page.The HTML parser muddles through. As a result you get documents with a structure you didn't expect, but you do see something; use the inspector to debug. [I'm not sure if this is a better or worse situation.]I think two aspects should be distinguished here. HTML was invented to display text document on the web. Today HTML is a host for more and more logic and data. While it might be acceptable that document structure is changed by a parser if it's purpose is simply the display of information for some humans. it's certainly not for logic and data marked up in HTML. Ambiguity is highly unwanted here.To sum up: complaints like 'that looks like XML and i don't like XML' are not an argument but an opinion and are IMHO not worth much arguing. Mostly such complaints are rooted in lack of competence and knowledge. Building good applications and components is a job for professionals that know about the importance of syntax.
Graphical tools will help the hobbyists in the mid-term.So, sorry i disagree that it would be 'a useful exercise' to argue against those complaints - the time would better be spent into refining the standard and implementations. - just my personal point of view.
On Wed, Oct 23, 2013 at 6:39 AM, Joern Turner <joern....@gmail.com> wrote:
Am Dienstag, 22. Oktober 2013 03:48:51 UTC+2 schrieb Dominic Cooney:I understand why the "it's like XML" complaint arises. Superficially, it looks a bit like XML:- The element names are "namespaced" with x- polymer-, etc. This looks a bit like an XML namespace.- The element names are either from a bespoke ontology defined by the author or (increasingly) some defacto standard one (libraries, in the case of Web Components.) But not ones the reader is necessarily familiar with.- The elements have close tags. Like XML. Modern HTML practice is not to write markup, but to write instructions to the parser, for example:<!DOCTYPE html><div>Hello, world! ...Is really shorthand for "instructions": I'm using HTML 5, create document element, create head, append head, create title, append title, pop, pop, create body, append body, create div, append div, create text node, append text node, pop, pop, pop. Custom Elements take you away from this world a little bit, because the parser groks you less.I think programmers dislike XML for a variety of reasons. It would be a useful exercise to elicit what these reasons are, and see which ones apply to Web Components. Then you can walk people through it.Here's a rough first cut:XML Namespaces:XML namespaces suck because you have two extra values/parameters (the prefix and namespace URI) you have to keep track of everywhere. If you get it wrong you get empty result sets, malformed documents, or lots of xmlns spew from different parts of the document having different prefixes. You can't understand part of a document with reference to some xmlns declaration a thousand lines away. When you edit documents you have to trim xmlns declarations elsewhere.
Sorry if that's off-topic now... XML namespaces are neither elegant nor easy to handle all the time. Big BUT - in the world of complex compound documents and XML encoded data they play a important role and unfortunately nobody has come up with something easier or more elegant. But there are XML languages which simply wouldn't work without them. Aeronautical Information Exchange Model (AIXM) is used to encode all information needed to deal with air traffic - you certainly don't want to allow any ambiguity here.Web Components are much simpler: they always have one name. The prefix is part of the name. A specific element can't appear in two places with different prefixes; there's no namespace URI. There's no declaration of the prefix anywhere.Right - because they are simply part of HTML - so no mixing of namespaces. However we'll see if this will hold in the long run when dozens of e.g. layout components from different origins pop up and name clashes become more likely. One day we probably need an answer to this or live with clashes.Yes. I think XML Namespaces place the cost of avoiding clashes up-front. Web Components naming places the cost on the author who actually has a clash. In either approach, there's a (potential) cost.
Plethora of tag names/I don't know what these tags mean:XML documents are "hard" because I don't know what all of these tags mean.Well, also a matter of good or bad design. Decently designed XML is quite readable without much explanation while of course you can produce the complete opposite but that's true for any code - good variable names and well-structured code makes it readable and extensible while you can write absolutely horrible code in any language.XML is used for all kinds of random domains; Web Components are mostly used for UI widgets. So the tag names should be a bit easier to understand. [I think we could have a stronger answer to this. XML would refer you to schema, but schema is confusing. It would be nice if we had a practice of being able to say FooButton.documentation() or something and jump into documentation.]I'm not sure if i would limit web components to ui components. There are already example of non-UI components (localstorage, ajax ...) in Polymer.This is a good point. How should Web Components authors address this complaint?
I have to be careful or I get invalid markup:XML processors are often strict and spew lots of errors at you if you forget to close a tag. As a result, you see nothing/no output/scary errors.Well, same can be said e.g. for CSS ;) Syntax errors can scramble your whole page.The HTML parser muddles through. As a result you get documents with a structure you didn't expect, but you do see something; use the inspector to debug. [I'm not sure if this is a better or worse situation.]I think two aspects should be distinguished here. HTML was invented to display text document on the web. Today HTML is a host for more and more logic and data. While it might be acceptable that document structure is changed by a parser if it's purpose is simply the display of information for some humans. it's certainly not for logic and data marked up in HTML. Ambiguity is highly unwanted here.To sum up: complaints like 'that looks like XML and i don't like XML' are not an argument but an opinion and are IMHO not worth much arguing. Mostly such complaints are rooted in lack of competence and knowledge. Building good applications and components is a job for professionals that know about the importance of syntax.In my experience, people don't find this line of argument--that they're incompetent--very persuasive. Unless you're very gentle.Graphical tools will help the hobbyists in the mid-term.So, sorry i disagree that it would be 'a useful exercise' to argue against those complaints - the time would better be spent into refining the standard and implementations. - just my personal point of view.I think it would be a shame if "entry level"? developers didn't embrace Web Components. Web Components should expand the scope and complexity of what a given engineer can build, but particularly so for these developers since the gap from what you can do with a composition of HTML elements alone, to what you can do with a composition of Web Components, is so large (assuming you have a good set of components on your palette.)
I can definitely imagine my own horror if I were to open up a client project and top to bottom was all custom elements that I knew nothing about.
I figure in time some custom elements might become so commonplace that they achieve the same level of mindshare as seeing $ or .btn does today
1. HTML is about being accessible to everyone and as a self-taught programmer I believe the div soup is inaccessible to people who are interested in how a website works (Don't tell me you haven't been there before. I've learned so many things from Cmd+Opt+U) or even new coworkers who have to an encyclopedia and an expert to understand how a site is laid out before he can do anything, just look at this page. div>div>div...forever...
2. I'm worried devs will make tags that totally obfuscate their code for performance gains or to make it unreadable to outsiders (opposite of an open web see #1 above). Imagine if Google was filled with tags along the lines of <g-weibvlqbeqbiubqkjdbiuqbek> that only Google can understand. This has serious ramifications beyond my programmer-friendly point in terms of accessibility, SEO , etc. Its important to remember that HTML should be readable and comprhenible without a user-agent stylesheet hiding the tags and stuff.
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/40653bc6-0d68-47a0-90e9-7d484d4958f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/a9e3c6c4-813e-4f90-846b-784bfdf73da6%40googlegroups.com.
To the notion that the OP and others brought up regarding the desire for people to 'not use Web Components to make the whole site'... isn't that the point? Turning the entire application into granular, reusable, well encapsulated components that can be easily composed into larger specialized components in a declarative manner is pretty much the whole idea here. For me, that's been the promise of the web platform all along, and the great frameworks embrace this (Enyo, Facebook React, Polymer, X-tags). Markup is a natural expression layer for this compositional way of working. Enyo achieves their declarative composition with JSON mixed into the component's imperative declaration, and that's fine too, but the beauty of using markup is that you can easily embed and compose at the document level. That's HUGE! Please don't view that as even remotely a negative. Being able to compose semantic markup (that comes with rich functionality) at the document level brings clarity to the web development process. It brings the expression of what you want the app to do closer to the implementation of making it happen.Not only do I think people should be embracing this, I can attest to the power of doing so. Before Web Components was a glean in the collective eyes of the W3C, I have been using one widget/component based framework or the other, often writing my own (https://github.com/theVolary/feather). Once you get practiced in thinking through how to break the application up into small chunks of compose-able functionality, you will be pleasantly surprised at just how often you get to reuse your components in contexts other than the one you initial created it for. It also becomes a heck of a lot easier to re-organize things when requirements change.There is nothing wrong with markup, nor with using a component based approach to create the entire application.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/2cbd0bde-d7b6-4c68-acad-026cc30b474e%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Polymer" group.To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CAHbmOLbPH%3DywkXbbjekd_3%3DUxeVNR%2BTFesdkNHYiG165rgNuiw%40mail.gmail.com.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/polymer-dev/lzvaDViB_Ow/unsubscribe.
To unsubscribe from this group and all its topics, send an email to polymer-dev...@googlegroups.com.
Web Components are much simpler: they always have one name. The prefix is part of the name. A specific element can't appear in two places with different prefixes; there's no namespace URI. There's no declaration of the prefix anywhere.Right - because they are simply part of HTML - so no mixing of namespaces. However we'll see if this will hold in the long run when dozens of e.g. layout components from different origins pop up and name clashes become more likely. One day we probably need an answer to this or live with clashes.
The real distinction lurking beneath the surface of this thread is not between XML and HTML (though I agree that self-closing elements would be nice and namespaces or at least aliasing will definitely be required)
but rather between the web as URL+API vs the web as URL+Markup. If markup doesn't matter, then asm.js, DIV soup, famo.us and to some extent React may well represent the future of web development -- and as was mentioned before, we simply need to get over the warm and fuzzy feeling of being able to "View Source" (which is effectively compiled). But if markup _does_ matter (for apps as well as docs), then surely making it extensible is a winning move (i.e. open-ended vocabularies should be considered a blessing not a curse).I have a gut feeling that markup matters, even for apps (I enjoyed Adobe Flex and OpenLaszlo was fun as well), but where are such projects now (XUL?), and why is it so difficult to pinpoint the benefit of markup over "js-compiled" solutions?
On Sunday, October 20, 2013 11:57:41 AM UTC-4, Rob Dodson wrote:I think the most frequent gripe I hear about Web Components is that they look like XML and that totally freaks people out. I can definitely imagine my own horror if I were to open up a client project and top to bottom was all custom elements that I knew nothing about.
My own opinion is that they're almost like jQuery plugins. I don't see much difference in:
<div class="fancy-dropdown"></div>
$('.fancy-dropdown').dropdown();
and
<fancy-dropdown></fancy-dropdown>
and just like jQuery plugins, they're great if used in moderation but horrible if they constitute the bulk of your site. I realize that's not a very accurate analogy but I think it gets at my main point which is "If it does something mysterious then don't overuse it."
I figure in time some custom elements might become so commonplace that they achieve the same level of mindshare as seeing $ or .btn does today. Bootstrap is a good example. If I opened a document and saw <twbs-btn> then I could say "Oh! I know how Bootstrap buttons work. OK, moving on...". So my hope is that the good stuff will rise to the top and the best practice will be "liberally use the good stuff, but go easy on the esoteric or lesser known elements."
Does that make sense? What do you guys think?
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/57f37a96-70ed-4320-8f56-4e8b669ef7c7%40googlegroups.com.