3 ms·
You're missing the forest for the trees. Do you think your 200-word explanation is easier for a beginner to understand than "this value is immutable — it will
by yakshaving_jgt 6y ago
You're missing the forest for the trees.
Do you think your 200-word explanation is easier for a beginner to understand than "this value is immutable — it will never change"?
My initial argument was that JavaScript is a terrible choice for learning FP, precisely because it has so many caveats and is notoriously poorly understood, even by people who use it every day. Your lengthy explanation proves my point.
- zarathustreal 6y agoI find this argument a bit disingenuous to be honest, I took the liberty of spelling things out in my reply because I assumed you wouldn’t otherwise be able to see the point. An explanation to a beginner, which doesn’t require memorizing any additional gotchas, would be something like “variables hold values. Strings, numbers, booleans, and references are values. Variables declared with const contain values that are immutable. An object is not a value.”
- yakshaving_jgt 6y agoLikewise, I think it's disingenuous to suggest that "an object is not a value" is not an "additional gotcha". Differences in evaluation strategies is not really beginner material.