There's a great example being discussed this week all over Twitter, GitHub, Bugzilla and elsewhere. It involves a proposal to add a new method
Arrays. There are some good docs for it on MDN as well.
The basic idea is to allow an
Array containing other
Arrays, or "holes" (i.e., empty elements), to be compressed into a new "flat"
Array. For example, the "flattened" version of
[1, 2, [3, 4]] would be
[1, 2, 3, 4]. It's a great suggestion, and one of many innovative and useful things that have been added to
Array in that last few years.
So how does
One of the frameworks was MooTools. Among other conveniences, MooTools added a way to
Array type to add new properties and methods. MooTools did this in a way that causes problems: we have all be told that it's a bad idea to modify, "step on," or otherwise alter the definitions of the language and runtime without first checking to see if they are, in fact, available. We wrote code in 2007 using assumptions that don't necessarily hold true in 2018: the browsers change, versions change, the language changes.
class that everyone knew you'd be safe to use, since JS doesn't use classes! Well, much like hundred-year land leases, eventually things change, and what was true once upon a time doesn't necessarily hold today. It's easy to point a finger at MooTools (many people are), but honestly, none of us thinks with enough long-term vision to truly understand all the implications of our decisions now on the world 10, 20, or 50 years hence (code people are writing today will still be in use by then, I promise you--I was a developer during Y2K, so I know it's true!).
At any rate, MooTools'
flatten(), because they don't work exactly the same (i.e., different argument signatures), and any code that relies on MooTools' way of doing
flatten() will get...flattened.
And so, someone files a bug on the proposal, suggesting
flatten() get changed to
smoosh(). Before this gets resolved, imagine you have to make the decision. What would you do? Is "smoosh" logical? Maybe you'd say "smoosh" is silly and instead suggest "press" or "mix". Are those safe choices? What if you used a made-up word and just documented it? What about "clarmp"? What about using a word from another language? They say that naming things is one of the great problems in computer science? It really is a hard problem! On some level we really should have lexicographers sitting on these committees to help us sort things out.
I won't give you my opinion. I intentionally stay out of a lot of these debates because I don't feel qualified to make good decisions, nor do I feel like it matters what I think. I have ideas, possibly good ideas, but the scope and scale of the web is frightening. I've had the privilege to work with some amazing web standards people in the past, and the things they know blow my mind. Every choice is fraught, and every solution is a compromise. It's one of the reasons why I'm so patient with standards bodies and implementors, who try their best and yet still make mistakes.
One thing I do know for sure is that the alternative, where one person or company makes all the decisions, where old code gets trampled and forgotten by progress, where we only care about what's new--is a world that I don't want either. If I have to
smoosh() in order to live on a web that's bigger than me and my preferences, I'm OK with that.
It's easy to laugh, but instead I think we should really be thanking the invisible, hard working, well intentioned open standards people who do amazing work to both advance the front and guard the flank.