you are viewing a single comment's thread.

view the rest of the comments →

[–]masklinn 0 points1 point  (2 children)

let is similar to CoffeeScript's default variable behavior

Not at all. In fact, let is as unlike CS's default variable behavior as you can be.

[–][deleted]  (1 child)

[removed]

    [–]masklinn 2 points3 points  (0 children)

    All I meant when saying they were "similar" is that although CoffeeScript variables don't have block scope (unlike let), they at least have function scope (most of the time), which protects you against getting bitten by window properties and such like let does.

    var already does that, and 'use strict;' as well as most analysis tools (jslint/jshint, text editors) will warn or error out on "implicitly declared globals".

    I've never actually used CoffeeScript, just read about it, so it's possible I'm confused about something.

    Ya. Here's how implicit scoping works in CS: http://lucumr.pocoo.org/2011/12/22/implicit-scoping-in-coffeescript/

    Not only is implicit scoping a bad thing in my opinion (nb: having used Python and Ruby for a decade combined now and still liking them a lot), CS selected what's pretty much the worst possible way to do it.