JavaScript WeakMaps are not actually weak: they refer strongly to their contents as long as the key is alive.
This brings the list of imprecisely-named ECMAScript APIs to:
Map → OrderedMap
Set → OrderedSet
Promise.race → Promise.anySettled
WeakMap → Ephemeron
-
-
Replying to @mathias
Bah, they're plenty weak about the key, it's fine.
But jayzus, Ephemeron would have been a terrible name.4 replies 0 retweets 15 likes -
Approximately 0% of people know what an ephemeron is. (I still don't, despite being present for those discussions.) It's also hard to spell. So it wouldn't solve any confusion and it trips the word-complexity limit for APIs.
1 reply 0 retweets 0 likes
Replying to @tabatkins @bmeurer
The problem is that the name WeakMap implies more weakness than what JS WeakMaps offer. A name like Ephemeron or SideTable might sound strange but at least doesn’t suggest behavior that doesn’t match the feature.
12:17 PM - 3 Jul 2019
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.