Logic? Uhm… no.

Jason Knight
1 min readJan 17, 2021

Like most of this "functional programming" malarkey, the gross inefficiency from an execution standpoint and horrifying cryptic nature of the code really makes it look... well... DUMB. Don't Use, Mostly Borked.

This raging chodo we've seen of late for "functions for nothing", "callbacks for nothing" and other such hard to follow and overhead inducing poppycock.

More so when things like MAP and FILTER are used for nothing more than code obfuscation and the introduction of function call overhead that just isn't needed.

If you really think that:

const isNotDiscountable = (item) => {
return !item.discountable
}
const nonDiscountMessage = (item) => {
return `${item.name} is not available for discount.`
}
const discountableMsgs = cart.items
.filter(isNotDiscountable)
.map(nonDiscountMessage);

Is any better than:

var discountableMsgs = [];for (var item of cart) {
if (!item.discountable) discountableMsgs.push(
item.name + ' is not available for discount.'
);
}

In terms of speed or code clarity, you really need to learn more about how programming languages REALLY work.

But no, right now crazy nonsense like “for loops are evil” and “don’t use if” are so hot and trendy, people will use twice the code that takes ten times longer to run to avoid it… and gibberish pedantic “career educator” rubbish like “functional programming” is to blame.

--

--

Jason Knight

Accessibility and Efficiency Consultant, Web Developer, Musician, and just general pain in the arse