-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symbol VS string for the fantasy-land
property
#1
Comments
fantasy-land
the propertyfantasy-land
property
I'm up for Symbol. I don't know the implementation detail of Symbol, but using Symbol conforms the the use case for FL, for me obj[fl.map] is very like obj[Symbol.iterator] which is the convention for ES6. So besides of the potential performance advantage of using Symbol(I don't really know if there is), it feels nature for the normal JS programmer(like me) who knows the convention to use Symbol. |
I've yet to have anyone explain to me a single benefit of symbols given that they are defined in a global registry and thus share a namespace (just as strings do, really). |
Ok to play a devil's advocate a bit, here a couple minor benefits of Symbols:
|
As far as know, Nodejs is using Symbol for protocol alike thing in the internal module. So more developer would adapt to the idiom for the usage |
This was discussed when we made methods on prototype prefixed. And overall impression was that symbols don't add any value compared to just unique enough strings. See fantasyland/fantasy-land#146
I think we should revisit this. Although I personally still don't see any advantages of symbols, it might be the case that we just missing something.
The text was updated successfully, but these errors were encountered: