On Thu, Jan 26, 2012 at 4:42 PM, Glenn Maynard <[email protected]> wrote:
> On Thu, Jan 26, 2012 at 6:25 PM, Tab Atkins Jr. <[email protected]>wrote: > >> As I argued in < >> http://lists.w3.org/Archives/Public/public-webapps/2011OctDec/1520.html>, >> we should absolutely *not* be adding more boolean arguments to the >> platform. They should be exposed as boolean properties in an >> dictionary. > > > I don't find this compelling; you could make the same argument for any > optional argument. When you only have a couple arguments, the additional > verbosity is a loss, particularly if the argument is used frequently. > Depends on the argument type. For example, in document.createElement('div') it's pretty obvious that the string is the tagname. Whereas in node.cloneNode(true) it's not clear without looking at the signature of cloneNode whether true means deep clone or shallow clone. node.cloneNode({deep:true}) or node.cloneNode('deep') are clear without looking up the signature. That said, I sympathize that the overhead of creating an object or needing to do a string compare just for a boolean is kind of sucky.
