Elements of JavaScript Style
medium.com
medium.com
i think my mental parsing at a glance of the short version of the first example trips over how there are no parentheses around the "msg" parameter and it looks like an ordinary variable until i reach the "=>" after it
and in the second example, parentheses (expression body) are used instead of braces (block body) but with indentation that's typical for block bodies so you can't easily tell it's an expression body at a glance (also depends on how well your font differentiates "{" and "(")
> Sometimes we’re tempted to assign names to things that don’t really need to be named. The problem is that the human brain has a limited number of resources [...]
i don't think intermediate variables are all that bad, especially for things that'd make an expression too long to comfortably fit on a line
or is it something only functional programmers care about
i'm not a fan of the currying and point-free and other things and find them pretty unreadable but i never did that kind of functional programming (to my knowledge) so i am not legally allowed to have an opinion on them
Typically it involves the ritual inclusion of code which does not need to exist because the author is copying something else they saw (or literally copying and pasting from Stack Overflow). The essence of the original article is the systematic _exclusion_ of code which does not need to exist -- that is the opposite of cargo-culting.
All of the guidelines exist for reasons which are well explained in the article. It's basically a guide that teaches you how to avoid cargo-culting.
If you're complaining that the guide encourages functional programming approaches, it's useful to admit that functional programming is an important capability of JavaScript (evidenced by the fact that functional utilities are built-in to the language).