Honestly the "always use let/const" BS is 100% nonsense... but then so is this obsession with block-level scoping from the same know-nothings who insist any function longer than three lines be broken into smaller subfunctions.

If you just opened a function, LET serves no purpose. Since CONST aren't actual constants/defines, CONST serves no legitimate purpose... and if your code is bleeding scope, the solution is to stop bleeding scope instead of blindly hoping that LET will handle it for you.

It's all just mollycoddling people with bad habits and worse practices!

... and really if you're going to group them together, comma delimit them instead of going full Gungan saying var/let/const on each and every Joe-blasted one!

It's a laugh how much of this idiocy could be avoided if people just understood function scope, used function scope, and perhaps practiced forward declaration with verbose naming conventions.

But no, we have all these halfwits, morons, and fools who seem to thing needlessly cryptic crap like arrow functions, callbacks for everything, 200 lines of functions for what should be twenty lines of code in one function's flipping job, and garbage code practices like "declare the variable at use time" all somehow magically makes the code "clearer", "simpler", or "better".

It doesn't.

Just look at the absolute chazerei of that last example with the function for NOTHING as "getGreeting", the illogic of doing the get BEFORE you even know if you need it, the stupid use of CONST and the aggravatingly cryptic arrow function to replicate what a normal function basically provides out of the box, and the derpy pointless back-tick template string crap with it's lack of code clarity and pointless poor performance.

All to do the job of:

const greeting = 'hi';function greet(name) {
return name ? greeting + ' ' + name : '';
}

… and that const could probably be a simple var if one is isolating scope with a IIFE. Hence why this “block include” crap is a pointless redundancy that only throws more complicated code and convoluted techniques at a non-issue.

It’s idiocy like this that’s why we see slow loading websites that drain mobile batteries that need to be pitched in the trash and started over from scratch. I see it every blasted time I take on a new client with accessibility or efficiency woes.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store