Implicit coercion of Symbols
waldron.rick at gmail.com
Sat Jan 3 15:29:46 PST 2015
On Sat Jan 03 2015 at 5:56:33 PM Brendan Eich <brendan at mozilla.org> wrote:
> Rick Waldron wrote:
> > Subjectively: I think it's nice in theory, but bad in practice.
> Compared to what? Converting a symbol to asilent-but-deadly string?
Sorry, that was poorly delivered—I was editorializing on the benefit of
exception vs consistency vs expectation. I still agree that
silent-but-deadly string issue is problematic, but it seems like an edge
case for Symbols. Yes, plenty of code concatenates strings and/or numbers
to make an object key or an array index; but just like "[object Foo]42" or
"undefined42", "Symbol(description)42" is a obvious mistake and has the
same bad outcome as the preceding two. The exception sucks and silent
strings suck. I don't know which sucks less ;)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss