Show newer

@onfy i think many are saying this only because they know ill report them if they say otherwise

did not expect some "do we like Caleb" discourse first

fuck you google i dont want your stupid "AI mode"

shouting 

FARM FRESH HONEYCRISP APPLES MY BELOVED

@aescling @monorail yes all of this is valid but polluting the global namespace is the most important code smell

@vaporeon_ never mind I took some tylenol and my autism came back

re: wrong 

@vaporeon_ @monorail in javascript functions can be reassigned

so lets say you work on a web site for your company that uses old-ass ES5 javascript because it was first made in 2009 and its for a government contractor who won't fund what is necessary for your team to change to a newer javascript workflow, so you're stuck with it

In one file, a coworker who no longer works at the company 10 years ago created a function called gorp like so: function gorp() { /* whatever gorp does */}

Now, today you are working on a file that has a function called girp and you reassign it something else. However, you make a typo and write gorp instead. This does not throw at runtime because gorp is global, and now you have bugs that are extremely difficult to decipher because you didn't notice a typo

@vaporeon_ @monorail if my web page loaded two javascript files, (lets call them one.js and two.js)

and one.js defines a function

function globalFunc() {
console.log('I am global');
}

then two.js can use that function

@monorail this doesn't work in node.js for whatever reason, shittyRandom1 is not added to global scope

@monorail function declarations create global variables because javascript sucks

Show older
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.