test.ical.ly | getting the web by the balls

Aug/11

18

Getting ready for CoffeeScript using Symfony2 and Assetic

After playing around with Sass and compass for an optimized CSS experience and some first results I now want to focus on easing Javascript development and CoffeeScript seems to be all the rage today.

Although I read that CoffeeScript does not depend on Node.js the CoffeeScript website mentions it as a requirement so I installed it first (with root priviledges).

I did this on a Gentoo linux box and while Gentoo is almost never featured in any installation instruction this worked right away so I guess it will be the same experience on all Linux derivates. I should mention that in contrast to the official instructions I did not install for a specific user but for the entire system.

Next install the Node.js package manager npm.

Now finally install CoffeeScript itself.

Next I had to configure Symfony and Assetic in order to utilize CoffeeScript.

And then make use of it.

To test this I simply copied some of the example code from the CoffeeScript homepage into a .coffee file. Right away it compiled into Javascript so I knew the installation was sound.

Now I have to do some CoffeeScripting. :)

· · · ·



  • Nick

    Doesn’t debugging become nightmare with such a nice flacky technology?

  • http://test.ical.ly Christian

    @Nick I don’t know yet but that is something I’ve heard a couple of times even by supporters of CoffeeScript. On the other hand CoffeeScript is supposed to be far more readable than Javascript and shorter so you can easier get into it which reduces maintenance time. I simply don’t know and I have yet to try but will report. :)

  • http://blog.vworld.at/ David

    CoffeeScript seems like an interesting idea, but for me both the written and the generated code “smell”. The written code kinda looks like VB6 and the generated stuff misses some optional brackets, which I think of as a very bad practice (of course this is just my opinion). I, too, see a debugging hell cruising in at full speed.

    I also don’t think that not having to declare your variables makes better code – just think of typos which result in perfectly valid, but multiple, variables.

    The only part that looks really helpful is the inheritance stuff – this is also where the most LOC are saved by using CoffeeScript.

    Good luck! :-)

<<

>>

Theme Design by devolux.nh2.me