On Fri, Jan 27, 2012 at 11:04 AM, Tab Atkins Jr. <[email protected]>wrote:
> ...yes? It can be. I made the general argument above - if an > optional argument has *no relation* to expected future optional > arguments, then it shouldn't be an optional argument at all, it should > be a keyword argument instead (implemented in JS via a dictionary > object arg). Otherwise authors will end up being forced to specify > the "optional" argument with a dummy value just because they actually > want to specify a later optional argument. > > You should only create multiple optional arguments when specifying a > later one *implies* that the earlier ones should be specified as well. > You shouldn't create a *single* optional argument if you expect that > it won't have such a relationship with things made in the future. > I never argued against any of this. My point, again, is against this: > 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. Naked bools are impossible to decipher without memorizing > the call signature of every function. Booleans are no more "impossible to decipher" than numeric or nullable arguments; there's nothing especially opaque or mysterious about them. We definitely should not make *every* boolean parameter a dictionary parameter just because it's a boolean, which is what the above claims. -- Glenn Maynard
