I do understand the technical difference very well - I have a PhD in implementing programming languages with function scoping like JavaScript.
If you agree with the person I was replying to maybe could you humour me and explain why you think function-scoping var is a useful feature?
I am happy for your PhD and that it is for implementing programming languages like JavaScript.
My assertion is the advantage of having function scoping is apparent to those who understand function scoping. Block scoping-style programming in JavaScript was always, in my experienced, shoe-horned in by people who wanted to make JavaScript more like Java. That is all there is to my point.
But even if it should be apparent to me, why can't you explain the reason to me? What is this - some kind of argument that is impossible to comprehend unless you already agree with it?
I can understand your argument that block scoping was shoe-horned into JavaScript, post hoc, but that isn't a technical argument for the benefit of function scoping, is it?
if(...) // use angel brackets
foo = 1; // declare variables
if(foo) ...Personally, I think the benefits of let are worth killing off var. I have honestly never seen an example where hoisting has been more clear than the alternative (declaring variables before they're used).
I assert that if you can't say what the advantage is then you don't understand it yourself.
"You'd see the advantages if you understood this, and since you don't you must not understand it" is not a reasonable thing to say to people.
Please provide an example of what you believe to be a good usage of hoisting.