What does HackerNews think of prevent-smoosh?
Don't let TC39 use smoosh or smooshMap
a) didn't know how to recognize a cheeky straw man proposal
b) didn't know how to take a joke
c) didn't agree with (or understand the importance of) the never-break-the-web imperative that TC39 operates under (turns out this is a lot of people)
tried to do exactly this to "prevent smoosh":
- https://github.com/staltz/prevent-smoosh
- https://twitter.com/andrestaltz/status/971500672620351494
Mostly, though, they just taught TC39 to have less fun and to ignore the "just break the web it's okay!" crowd.
Why TC39 operates under this never-break-the-web imperative: because if they didn't, every proposal they consider might devolve into an unresolvable discussion of "well is THIS thing important enough to break the web over? how much usage would this change break? how valuable do we think this is?". The easiest, and only, way to resolve all possible such discussions is to just not have them.
The former is a property getter/setter implanted into the Array object¹. The latter is a function that returns `[].length - 1 || 0`.
¹ I know planting properties and functions directly onto the basic objects is generally frowned upon, but I see no harm in doing that for personal projects. Using it in the big-web production might be verboten, but it doesn't I can't make my coding life a bit easier.
Meanwhile, I have a problem with the "web compatibility naming safeguard" argument over the names of the proposed properties/functions. Surely, the websites using `[].last` override the namespace to begin with. If, say, `[].last` were to be accepted, how could it break the sites using the override version?
Outside of that, the fact that new proposals have to cow before a widespread conventional use of the names renders me confused. I feel like the JS engine should take priority over mere convention. Sure, some websites might be hurt in the process, but at least the generations of current and future coders would have few problems figuring out what the new functions do.
Exhibit 1: `globalThis`. Nuff said?
Exhibit 2: `[].smoosh`, which apparently was in the books [https://github.com/staltz/prevent-smoosh]. No longer is: it's now `[].flat`.
Exhibit 3: `Math.clamp()`, in questions [https://github.com/rwaldron/proposal-math-extensions#questio...] for the `Math` extension proposal. (Yet undecided-upon.)
`[].last` just makes sense.