VisezTrance

  • October 6, 2011 7:55 PM

    Nodejs and coffeescript

    By Daniel
    My first contact with nodejs was at Yahoo's open hack event that took place at Bucharest last spring. It was fun, however I just couldn't find the time to tinker with it as much as I would've liked to.

    Lately this changed, and I'm actually using it for a project we're developing at work where it fits the bill quite nicely. While I'm quite familiar with javascript I'm coding in coffeescript. Initially I was reluctant on using it especially as I'm not very found of indentation based languages, but as far as backend javascript developing goes, it's a god send.
    I think that the main reason I like it despite its flaws (it's just a wrapper after all) is that it almost forces good coding practices such as using short methods and avoiding deeply nested constructs.

    I'm using the emacs coffee mode extension to compile my coffee files to js on each save. I imagine that most major editors have similar extensions as well.

    Restarting node on each change can get a bit tiresome. To resolve this I'm using the supervisor plugin:

    npm install -g supervisor

    And instead of starting the application with node:

    supervisor -p server.js

    Basically the browser can now be refreshed on each coffee file change. Neat.

    Tags:

    • coffeescript nodejs
  • Monthly Archives

    • October 2013 (2)
    • May 2012 (1)
    • October 2011 (1)
    • September 2011 (2)
    • March 2011 (3)
    • February 2011 (1)
    • January 2011 (1)
    • September 2010 (1)
    • August 2010 (1)
    • June 2010 (1)
    • April 2010 (1)
    • December 2009 (1)
    • October 2009 (1)
    • September 2009 (1)
    • August 2009 (1)
    • July 2009 (2)
    • April 2009 (2)
    • February 2009 (1)
    • January 2009 (2)
    • December 2008 (1)
    • October 2008 (1)
  • Pages

    • About / Contact

2008, © Daniel Mircea