Andrey (azangru) wrote,

I remember a TC39 proposal, from several years ago, to introduce the common name for the global namespace object, which is referred to as window in the browser, and global in Node. The proposal was to uniformly call it global.

I haven't been following this proposal, and today I learnt that the proposal has been given a go-ahead, but the name has been changed from "global" to "globalThis". The reason — introducing the keyword "global" into the language broke Flickr, which was using it for some bundling purposes; and probably some other sites as well.

I don't have any particular feelings about the globalThis, but this episode reminded me of the recent dropping of array method name "flatten" in favor of "flat", because an ancient library called MooTools was monkey-patching the Array prototype adding its own "flatten" method to it, and it had a different type signature. That decision I minded a lot. MooTools have already gone into oblivion, while whatever enters the language stays; and to be influenced by bad decisions of old libraries while evolving the language is irresponsible. A method name should be a verb. Flatten is a verb; flat is not.

  • (no subject)

    To the future me: I keep returning in my mind to the simple idea in this talk about containing React component's logic in a custom hook and having a…

  • (no subject)

    I've been listening to The Boys produced by the Graphic Audio. Better than the film; more irreverent; the Butcher character is even more profane and…

  • (no subject)

    I don't think I was even taught about the Holocaust in school. If I was, it probably was just a footnote somewhere. History wasn't among my favorite…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.