3 ms·
I don't think it's that bad but I wish they'd focus more on improving the terrible JS web API rather than adding language features. I mean they are adding feat
by IshKebab 4y ago
I don't think it's that bad but I wish they'd focus more on improving the terrible JS web API rather than adding language features.
I mean they are adding features like static initialisation blocks when we only just got String.replaceAll(), and they somehow managed to fuck that API up despite it being explicitly a replacement for an existing bad API!
Where are all the containers? Sorted sets/maps? Why can't I even map an iterator?
- HeavyFeather 4y ago> focus more on improving the terrible JS web API That's W3C’s job, not ECMA’s. > Where are all the containers? ? > Sorted sets/maps? Sets and Maps are sorted (by insertion order) > Why can't I even map an iterator? It's coming, but someone will likely be exhausted by that addition. https://github.com/tc39/proposal-iterator-helpers https://github.com/tc39/proposal-iterator-helpers
- IshKebab 4y ago> Sets and Maps are sorted (by insertion order) That's not what a "sorted set" is. C++ and Rust provide sets (and maps) that sort based on an arbitrary comparison operator. > ? ? > but someone will likely be exhausted by that addition I suppose. I guess it's one of those things that they really should have got right the first time. Like String.replaceAll(). I guess they will never add String.replaceAllSafe() - well just have to rely on linters to tell us that the API is terrible forever.
- TheCoelacanth 4y agoBy sorted sets/maps, I think they are referring to a binary-search-tree-backed implementation that is efficient for operations like find all keys between x and y, e.g. something like Java's SortedSet[1]. [1] https://docs.oracle.com/javase/7/docs/api/java/util/SortedSet.html https://docs.oracle.com/javase/7/docs/api/java/util/SortedSe...