flâneur — a map of the web's best reading

A fucking rant about fucking const vs fucking let - @jamiebuilds

jamie.build · 912 words · saved by 1 readers

I didn't want to be the guy write this post, but I am because Chris told me to so blame that fuckin guy. I'm a victim here. But you're all using const in JavaScript too much and it does bug me just ever so little. For starters, let's agree that const is fucking useless and we're inventing meaning... const does not imply any kind of immutability of the value itself, it only implies immutability of the binding. Which... Cool. Let's also eliminate the idea that we could somehow statically enforce that const values are immutable with a linter. Like, sure, you could for the simple case: But then like... side effects exist and shit will hurt you And yeah, type systems like Flow and HiHaveYouTriedTypeScriptYouShouldReallyTryTypeScriptIWriteTypeScriptAndImFuckingObnoxiousImGonnaStickMyHeadInAMicrowaveAndScreamTypeScript™ could do something with this, but like... they don't... sooooo You might be thinking, "Oh but it can still be used to optimize code or whatever" You would be right in thinking

A fucking rant about fucking const vs fucking let - @jamiebuilds A fucking rant about fucking const vs fucking let I didn't want to be the guy write this post, but I am because Chris told me to so blame that fuckin guy. I'm a victim here. But you're all using const in JavaScript too much and it does bug me just ever so little. 1. const doesn't do shit and we all know it For starters, let's agree that const is fucking useless and we're inventing meaning... const THIS_SHOULDNT_CHANGE = { right: "?" }; THIS_SHOULDNT_CHANGE.right = "wrong" ; THIS_SHOULDNT_CHANGE. fucking = "deal with it" ; const d

Explore this link on the map →

related reading