News for hackers. Stuff that matters.
Re:How to Write CoffeeScript Efficiently by skrebbel on Tuesday November 29, 2011 @08:46AM (#3290240)
Should have been renamed to "Some Vim tricks for CoffeeScript writing".
Re:How to Write CoffeeScript Efficiently by nilbus on Tuesday November 29, 2011 @08:25AM (#3290177)
Could someone explain how {@foo} = bar compiles into this.foo = bar.foo;?
Re:How to Write CoffeeScript Efficiently by yesbabyyes on Tuesday November 29, 2011 @08:41AM (#3290230)
"@" is an alias for "this.", so "@foo" is the same as "this.foo".

{foo} = bar is using destructuring assignment, it means, take property "foo" of bar and put it in variable foo, so

    {foo} = bar
compiles to

    var foo = bar.foo;
Re:How to Write CoffeeScript Efficiently by nilbus on Tuesday November 29, 2011 @08:57AM (#3290270)
Thanks! It was the destructuring part that I wasn't understanding right away.
Re:How to Write CoffeeScript Efficiently by yesbabyyes on Tuesday November 29, 2011 @10:18AM (#3290607)
No problem! CoffeeScript's destructuring is really nice, IMO:

    [first, rest..., last] = someArray

    professions =
      programmer:
        studyTime: "5 years"
        salary: 10000
      salesman:
        studyTime: "2 years"
        salary: 15000
    
    {programmer: {salary}} = professions
    
    console.log "A programmer's salary is %s", salary
EDIT: Fixed bug, "developer" should be "programmer".
Re:How to Write CoffeeScript Efficiently by jrnkntl on Tuesday November 29, 2011 @10:31AM (#3290682)

   {developer: {salary}} = professions
Re:How to Write CoffeeScript Efficiently by s00pcan on Tuesday November 29, 2011 @08:50AM (#3290250)
I followed the link to the Syntastic plugin and can't get it to work. The version on github doesn't have the SyntasticEnable function for some reason, so I used the package on vim.org. I added the statusline changes and SyntaxEnable php to my vimrc, still does absolutely nothing. I'm not seeing anything different on my statusline when saving files and the :Errors function doesn't show anything either. Ideas?
Re:How to Write CoffeeScript Efficiently by diploid on Tuesday November 29, 2011 @01:50PM (#3291602)
Manually compiling your CoffeeScripts just seems archaic. Is there no equivalent to Sinatra AssetPack for node.js?

Frankly, this is not an efficient workflow for CoffeeScript.

Re:How to Write CoffeeScript Efficiently by Epeli on Wednesday November 30, 2011 @06:58AM (#3294745)
Re:How to Write CoffeeScript Efficiently by VMG on Tuesday November 29, 2011 @08:58AM (#3290279)
sadly, this could also be called "why it is difficult to write CoffeScript efficiently without some vim plugins"