Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Right now I am developing web applications with ruby-on-rails. Sometimes I am having a hard time deciding which language to chose to solve my problems.

The difference between HTML,CSS and the programming languages is pretty clear. But when do I have to take JavaScript instead of Ruby (besides client-server difference)? Thanks!

share|improve this question

migrated from stackoverflow.com Oct 18 '11 at 5:22

This question came from our site for professional and enthusiast programmers.

    
Hi Sebastian, I think you're raising a good question, but it's very vague and thus might be down-voted and closed. Could you please make clear what you mean? It's obvious that you have to use Ruby on the client. What is it that you exactly want to know? You might need to change the question, too: It sounds as if you want to know what blogs/books to read to stay up-to-date with changing web technologies (but I don't think that that is what you want to know). Cheers, Johannes –  Johannes Fahrenkrug Oct 18 '11 at 5:28
    
And don't forget to accept an and up-vote answers :) –  Johannes Fahrenkrug Oct 18 '11 at 5:36
    
Need reputation to do that - new to stackoverflow (concerning the membership) –  Sebastian Oberste-Vorth Oct 18 '11 at 5:44
    
Accepting an answer should work though, I think. –  Johannes Fahrenkrug Oct 18 '11 at 6:46

2 Answers 2

up vote 1 down vote accepted

It heavily depends on what kind of web application you are building. Is it a page-like application with very little dynamic elements (like an online catalog) or is it an application -like application (yes, that sounds stupid)?

What do I mean by that? Well, should the application enable the user to do a lot of things in the browser that immediately update the view without reloading the page? Maybe a todo-list application or an application that lets the user configure the next car they want to buy or something like that? Then you should just load the page once and use JavaScript to communicate with your Rails backend and update your view. Preferably you should use a framework like SproutCore, Cappuccino, or Backbone to help you keep your JavaScript application organized.

This is a somewhat dated but still relevant example of using Cappuccino with Rails by the great Thomas Balhazar.

This shows you how to use SproutCore 2.0 with a Rails backend

And finally, this shows you how to use Backbone with a Rails backend.

Of course you can also use JavaScript on the whole stack with node.js and frameworks like SocketStream. That way you can use JavaScript both on the client and on the server. But those frameworks might not offer as many conveniences as Ruby on Rails at this point.

So it comes down to deciding what kind of application you are building.

share|improve this answer

Ruby on server-side, javascript on client-side.

share|improve this answer
    
Yep, thats true. But in some cases you can use both to achieve a certain goal... that is where I start struggling... –  Sebastian Oberste-Vorth Oct 18 '11 at 5:07
    
@Sebastian Cases such as? –  Can't Tell Oct 18 '11 at 5:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.