Reputation: 14159
I bought "Beginning Ruby: From Novice to Professional - by: Peter Cooper".
Being from a .NET background, I guess:
Ruby is to C#, and Rails is to ASP.NET
when compared. Please correct me if I am wrong. Should I learn Rails along with Ruby or first I need to dip my hands well in Ruby? Do I need knowledge of Rails necessarily for developing a web application? Without Rails, what things can be done with Ruby alone?
Upvotes: 1
Views: 244
Reputation: 594
Coming from a .NET background you might also consider this title:
Rails is not really so much like ASP.NET as it is like the new ASP.NET MVC; or rather, the other way around.
I would definitely try to get a grasp of Ruby before diving into Rails. Rails does Ruby a certain way and knowing Ruby before venturing into Rails will give you a better overall grounding. Also, Rails is by no means the only option for web development in Ruby. I would recommend looking at Sinatra, Ramaze and especially Rack (which undergirds all the significant Ruby web frameworks, including Rails).
In terms of what can be done with Ruby, you can accomplish pretty much anything you can accomplish with any scripting language. And there are projects out there to accomplish many of the same things you would use C# for. Ruby is a general purpose language, so you can do pretty much anything with it. It is best known because of Rails, but it is good for a whole lot more than just web development.
Upvotes: 0
Reputation: 281
I highly recommend learning Ruby first. Ruby is an amazing tool that any programmer can benefit from. I wrote many scripts that saved me a ton of time in Ruby before even learning Rails. I even wrote a sinatra/sequel business intelligence webapp before learning rails. You'll be a better rails programmer if you truly understood ruby.
Upvotes: 0
Reputation: 199195
Should I learn Rails along with Ruby or first I need to dip my hands well in Ruby?
No, you could learn both at the same time. You should understand the language basics first, of course. But you don't have to dip your hands well before.
Do I need knowledge of Rails necessarily for developing a web application?
No, there are other webapp frameworks for Ruby, but RoR is the most famous.
Without Rails, what things can be done with Ruby alone?
You can do as many things as in any other programming language.
See for instance the "Success Stories" featured on the Ruby site.
Upvotes: 2
Reputation: 23450
Personally I find it easier to learn a language when I've got a project to complete. That's where Rails comes in, by providing a framework for web development, you can make any number of web based hobby projects easily.
Just reading and blindly following tutorials does not help things sink in. Especially when I have established comfortable ways of doing things in other languages.
Ruby is a breath of fresh air coming from the more formal languages in the .NET suite. If you've never worked with any dynamic languages before (Python, Perl, etc) You're in for a ride. The most important learning tool is the Interactive Ruby shell. If you ever want to play around with code just start typing into irb. Books definitely help but just throwing statements and fragments at the interpreter is going to to help you understand what's going on under the hood a lot faster than memorizing method calls and library APIs.
As for books on Ruby look up _why's Poignant Guide To Ruby. It's unlike any other programming book you've ever seen, which is fitting if you come from the .NET side of things where Ruby introduces a number of very foreign concepts. If you haven't done anything with closures before, expect to get blindsided by blocks.
The only hard part of learning Rails and Ruby side by side, is determining what parts of your code are Ruby, and what are Rails helper methods. Stick with it and you should be fine.
As for what can be done in Ruby without Rails? Just about anything. It's a fully featured language, suited for many tasks. But I wouldn't trust it for things with Hard Realtime Requirements
I'm not a .NET person. So I can't comment on the similarities of the relationship between Ruby and Rails and the relationship between c# and ASP.NET. What I can tell you about Ruby and Rails comes from a talk I saw given by Chad Fowler. It was called "Rails is boring, and Ruby is a toy." Which is the most succinctly accurate description possible.
Rails does most of the heavy lifting in your web apps by taking a convention over configuration approach. Meaning if you define things in a manner that Rails expects there's minimal configuration to be done. Rails is a Framework of helpers written in Ruby to implement the MVC methodology of a web service.
Upvotes: 1
Reputation: 19131
This may sound odd, but I learned Ruby as a side-effect of learning Rails. I chose to learn Rails because I wanted to create a database-centric website and saw that Rails appeared to be much simpler for that than using a Java-centric stack (my comfort zone). I dove right in without looking much at the language (Ruby) and now have a pretty decent website using a large number of Rails plug-ins, that integrates with web services, does image processing, etc. Rails is a Ruby-based framework, so clearly I was learning Ruby along the way, but I didn't feel I needed a Ruby foundation before jumping in. Perhaps this is because Rails is chock full of DSL (domain-specific language) customizations. A little backwards, but it worked for me :-)
Upvotes: 0
Reputation: 39325
Your analogy is correct. Ruby is a language, Rails is a framework.
If you want to do web programming you could learn any of the ruby web frameworks (Rails, Sinatra, Merb...). Rails is the most popular and it's pretty quick to learn (gotta love the convention over configuration concept, because it helps you get off the ground faster). I can't recommend this book enough for rails (and its got a decent ruby primer as well).
Ruby by itself is a good general purpose programming language.
Upvotes: 0
Reputation: 15482
You are right about the comparison, That Ruby is like C# and ASP.NET MVC is to Rails ( well sort of ). Rails is a framework written in Ruby.
Rails seems to be the preferred way of Developing Web Apps in Ruby. There are other frameworks like Merb( which is merging with Rails ), Sinatra and Ramaze.
You can still build your web app even without using these frameworks, but that is equivalent to complicating your own life and is out of scope of this discussion.
You can learn Rails and ruby side by side, when you get better understanding of Ruby you can delve into deeper matters of developing standalone web apps with ruby :)
Upvotes: 0
Reputation: 5861
Ruby is a language. Rails is a framework written in Ruby. The only reason you'd need to learn Rails is if you want to write applications based on it.
Upvotes: 0