Re:How to integrate AngularJS with Rails 4
by michalkw on Tuesday October 01, 2013 @11:23AM
(#6476747)
I guess it goes both ways. I have to mentally translate all those boilerplate curly mess when reading JavaScript and find CoffeeScript much easier to understand. CoffeeScript is much closer to Ruby syntactically, not to mention a Rails default.
I find coffeescript so much easier to read - I welcome the coffeescript examples and wish there were more.
Re:How to integrate AngularJS with Rails 4
by nachteilig on Tuesday October 01, 2013 @11:20AM
(#6476734)
I am absolutely with you here, but it seems that a lot of people are using coffeescript in tutorials because it's become the de-factor convention for Rails apps.
Fortunately for us, it's relatively easy to convert it to regular javascript.
Re:How to integrate AngularJS with Rails 4
by latortuga on Tuesday October 01, 2013 @11:55AM
(#6476960)
Bottom line: everyone who knows coffeescript knows javascript. The inverse is not true. Personal preference, de facto standards, "it's just like ruby" - none of this has to even come into the equation.
>everyone who knows coffeescript knows javascript.
Is this necessarily true? You can't put coffeescript between script tags and just have it run, as it's designed to use incompatible idioms which need to be 'compiled' to js (because js is ugly and awkward).
It's entirely possible someone who has only ever used coffeescript and has a deep aversion to js has no idea how to actually write the js version of whatever it is they're coding.
That's assuming they've never had to debug one of their programs, ever. Even with a distaste for braces and semi colons they will have to eventually look through the compiled code, or run through something like js2coffee.
Rails has defaulted to scaffolding with coffeescript and sass since version 3.1. It makes sense then in the context of a rails 4 tutorial, that the code would be in coffeescript.
Re:How to integrate AngularJS with Rails 4
by psychometry on Tuesday October 01, 2013 @11:30AM
(#6476799)
Maybe the solution is to incorporate js/coffeescript switcher tabs into the code boxes. It would be a pretty easy feature to add to a code highlighting library.
Javascript is the lingua franca of frontend web development. Stick to that.