◄►
Home

Globals Rule

Globals allow us to redefine JavaScript Itself

Meta-OS uses a lot of global variables. It's a Web framework, so it's always interacting with the DOM, canvases, audio contexts etc.
I don't want to type "document.getElementById" a million times. I'd rather type "dge" instead.
I don't want to use JavaScript's shitty "typeof" operator, so I wrote my own "tof" function.
But the current fashion is to move everything into the ES module system. In this system, each module has no knowledge about the others, it's all private. That's fine, I get why that's important for serious applications. But what about the 99% of apps that don't need to worry about conflicts, or where security is a simple extra layer on top?
Even the most complex webapp I've written, a fully-featured music studio, didn't need private variables or sandboxing. However, the idiots behind AudioWorkletNode made it impossible to access globals, and a ridiculous pain in the arse to one-file your audio app. They are imposing a coding style on us - ie. each Worklet has to have it's own file, and you may not extend JavaScript with your own globals.
That sucks. Meta-OS thrives by using globals to eliminate complexity.
I reserve the right to modify JavaScript in any way I see fit, by adding global functions, variables and constants, as Brendan intended.
Let's stop this "ES module" bullshit in its tracks.