>And my point is that you can't watch out and protect yourself from it
Of course you can. You simply enclose the block in an immediate function (using "do") and declare your local variables as parameters to the function. Do that, and it is impossible for any outer scope to screw your code up.
If you're working on a project where lots of coders of questionable aptitude are going to have commit access, you make declaring local variables this way a required convention.
If you're working on a project where changes get approved by a small number of capable maintainers, then you:
1. Do not allow commits that create short or common names (i, x, arr, log, etc.) in high scope levels, and
2. Require that short or common names in inner scopes be declared using local scoping via "do".
Now, should CoffeeScript give some nicer sugar to encourage this kind of local variable use? Yes, probably. But it is incorrect to say that CS doesn't give you the tools to protect yourself from outer scope pollution.
Ok, you can protect yourself by doing weird defensive coding gymnastics, but you can't protect yourself by just writing good code. I'd rather use a language that doesn't make me do gymnastics.
Weird defensive gymnastics? It's just using a language feature the way it's meant to be used. How is that any more "gymnastics" than the ":=" syntax recommended by the article you linked?
It isn't only for that, and as I said, it doesn't have to be used for that. But it's an effective way to do things, and it is one of the purposes of the construct.
Of course you can. You simply enclose the block in an immediate function (using "do") and declare your local variables as parameters to the function. Do that, and it is impossible for any outer scope to screw your code up.
If you're working on a project where lots of coders of questionable aptitude are going to have commit access, you make declaring local variables this way a required convention.
If you're working on a project where changes get approved by a small number of capable maintainers, then you:
1. Do not allow commits that create short or common names (i, x, arr, log, etc.) in high scope levels, and
2. Require that short or common names in inner scopes be declared using local scoping via "do".
Now, should CoffeeScript give some nicer sugar to encourage this kind of local variable use? Yes, probably. But it is incorrect to say that CS doesn't give you the tools to protect yourself from outer scope pollution.