Earlier quoted context omitted.
And my point is that you can't watch out and protect yourself from it, because the quirk can be triggered by different code from the code you're actually writing. You can carefully write code that works just fine, and then, unbeknownst to you, someone else can modify a completely different part of the file, and break your code. How do you protect yourself from that? By making sure that every single person with commit…
>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 declari…
Discourse ditches CoffeeScript
81–84 of 84 posts
Re: Discourse ditches CoffeeScript
#82Earlier quoted context omitted.
>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 declari…
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.
Re: Discourse ditches CoffeeScript
#83Earlier quoted context omitted.
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?
Re: Discourse ditches CoffeeScript
#84Earlier quoted context omitted.
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?
So the "do" syntax is meant to be used for all local variables? That seems kind of weird, but I'll take your word for it.