It's a good idea to name things explicitly in any programming languageโ€”not just JavaScript. It can make the difference between code that's easy to follow versus a complete clusterfuck.

When I discovered MaintainableCSS, I couldn't help but clap here:

As Phil Karton says, โ€œthere are only two hard things in Computer Science: cache invalidation and naming things.โ€ So spending a whole chapter talking about naming is essential.

Hell fucking yes! ๐Ÿ‘

I can't stand it when I see developers using unnecessarily short variable names, and for what? To save three characters?

Here's a common example: naming the parameter in an event listener.

// This is what I would do ๐Ÿ‘
function myEventHandler (event) {}

// But I sometimes see this ๐Ÿ‘Ž
function myEventHandler (evt) {}

// And even this ๐Ÿ˜ฉ
function myEventHandler (e) {}

Yeah, they all behave the same, and I sort of understand why some folks like the brevity. But not everyone does. You might know what an abbreviation means, but the person trying to read your code might not.

It's not obvious.

I've had to look at code before and figure out what the hell a pid variable meant. Turns out it stood for pageID. OK, so... Why not just call it that in the first place? It's only three extra characters, but so much clearer!

Here's another example from the Express documentation:

// GET method route
app.get('/', function (req, res) {
res.send('GET request to the homepage');
});

Again, it's not obvious what the req and res parameters mean. I don't care if it's the convention. Just be more fucking explicit.

// GET method route
app.get('/', function (request, response) {
response.send('GET request to the homepage');
});

Now, that's better. ๐Ÿ˜