Ruby on Rails
Wednesday, May 18, 2011
Coffeescript does not impact performance, not at all. It translates directly into javascript statements but takes the annoying parts, like prototype definitions and checks for undefined, out of it.
Here is a sample I did to show you the difference between the code. You will see that the javascript that is the compilation result is quite close to how it would have been written if done by hand.
Coffeescript https://gist.github.com/979717
Javascript https://gist.github.com/979725
| With 3.1 having so many changes when it comes to Javascript, does it make sense to setup your 3.0.7 project in a certain way to make it easier to upgrade later? |
I am quite new to the rails world, but even for me it is obvious that coffeescript combined with jquery will be the client/ language/lib of choice in Rails 3.1 and that RJS is dead. So it is sensible to start right now to develop future code in jquery and coffeescript, which directly answers the above question.
I also believe that backbone.js will be the winner for MVC for web based apps. Can't speak for mobile though
To answer another question: I pretty much ignore the built in ajax functionality, except for the delete functionality, which is nice. I use jammit and jammit-s3 instead of something like require.js, and personally I hope to use it in 3.1 as well. I also use backbone and coffeescript together to easily modularize my apps.
On Wed, May 18, 2011 at 3:07 PM, Mustafa C. <lists@ruby-forum.com> wrote:
Hi,
Not sure if I should start a new thread with the original question for
this one... this thread branched off to coffee script, I think it will
be awesome if we can get the sentiments of the folks here about the
questions put forth...
I don't know much about coffee script, and I am a follower in Rails
having not migrated to Rail3 either. What I know is that I don't like
going around the bush of things, and coffee script is that for me. So, I
want to use JS directly.
The question is: what is Rails' strategy for Javascript? I don't think
hiding it with things like RJS/CoffeeScript will yield good performing
apps. I am personally working to leverage JS directly, which gives me
the freedom at the client-side and the performance too. However, I am
not leveraging Rails enough that way. I, for example, use the Dojo
library; which is awesome for building a large app, though there is not
interworking with Rails that I know of. The original question above
mentioned libraries like backbone, require.js, etc. And in the mobile
space there is embed.js and others...
While I have Rails Conf videos on my TODO list to watch soon; can anyone
elaborate on what the direction is?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
Martin Wawrusch
p: +1 310 773 7346
I blog at http://martinatsunset.com : O API Marketplace, Where Art Thou
Follow me on twitter at http://twitter.com/martin_sunset
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment