A different semantics for WeakMap#get default value

Brendan Eich brendan at mozilla.org
Mon Jan 16 14:39:04 PST 2012


> Axel Rauschmayer <mailto:axel at rauschma.de>
> January 16, 2012 2:33 PM
>
> All boolean parameters are anti-patterns? All optional boolean 
> parameters? What’s the alternative?

I'm talking about formal parameters here.

>
> I thought that boolean parameters where OK when they were labeled in 
> some manner (e.g. via an object literal).

Those are not parameters, they are properties of an object parameter 
(which may conventionally be expressed literallly in the actual argument).


> But I always find unlabeled parameters problematic (beyond the first 
> one). Some of it can be mitigated by choosing good function/method 
> names. Furthermore, trailing callable parameters are often 
> self-explanatory.

String-valued parameters are self-documenting when used well. Same goes 
for enum in C/C++. Just vague true and false parameters, not so much.

/be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120116/1bd65308/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postbox-contact.jpg
Type: image/jpeg
Size: 1222 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120116/1bd65308/attachment.jpg>


More information about the es-discuss mailing list