开发者

Do I need to know Ruby in order to learn Ruby on Rails? [duplicate]

This question already has answers here: Closed 12 years ago.

I've read several other questions about material in order to learn RoR. But my question is can I star开发者_JAVA百科t learning RoR without Ruby?

It's clear that the other way around is better, but I would rather try this way if it makes sense (somehow). Or learn both in parallel...


Well, given that Ruby on Rails is just Ruby written in a particular fashion (read: framework) yes you will need to learn Ruby.

You will need to learn these things about Ruby (amongst other things):

  • Everything Is An Object. Everything. Yes, even 2 and "foo"
  • Class Inheritance and What It Does(tm)
  • How to tell the difference between class and instance methods
  • Modules and how to use them correctly (class_eval Is Your Friend)
  • People write gems. Use them. Re-inventing the wheel is fine and dandy for learning but re-inventing it because you think your method is better is not.

And these things about Rails:

  • Do not fight conventions.
  • Do not fight conventions.
  • Model code goes in the model.
  • Controller code goes in the controller.
  • View code goes in the view.
  • Helper code goes in the helper.
  • Ask yourself "Does Rails have a helper for it?". If the answer is "No" ask somebody else. The answer is likely to be "Yes".

And these things in general about learning:

  • Google it.
  • Google it again.
  • If the answer you seek is not within Googling distance, formulate it in a way that is kind to those who may know the answer (such as you've done with this question!)
  • Appeal to people's greater motives. How can helping you, help them?
  • Try not to be too much of a help vampire.
  • If asking in an IRC channel, use a pastebin service such as http://pastebin.com, http://pastie.org or http://gist.github.com
  • Second rule about asking in IRC: Don't ask "any ideas?" after your question. Your question should already ask this by itself.

And finally: Love what you do.


People used to say that you could learn RoR without knowing Ruby (including DHH, if I am not wrong).

But in my opinion, if you also know Ruby, you can do a lot more stuff than without knowing it. And the knowledge would be very helpful when you debug or troubleshoot your programs.

So my suggestion is learn both in parallel.


You can. RoR is in a way a domain specific language, since a lot is defined for you and putting a simple application together can be like following a straightforward recipe. It would of course be better to learn the language properly, but many people don't.

The Ruby For Rails book tries to teach you both at the same time, so you might want to look into getting that one. I haven't read it but I hear it's pretty good.


Obviously :) ... if you really want to develop good web apps ...

But it will also be interesting to first get your hands wet with some RoR sample applications using inbuilt features that RoR provides... and then learn the details(which will require knowledge of Ruby)

If you avoid learning Ruby, (that many of the RoR developers do)... then you will find yourself stuck at position and going through an alien code. And eventually you might leave RoR out of frustration. I have seen many of such cases.


The question you ask is slightly ambiguous. Specifically, you could be asking "Can I learn Rails without first knowing Ruby?", or "Can I learn Rails without having to learn Ruby too?".

The answer to the later question is probably no, if you want to be particularly functional with it. Without knowing Ruby, it would be hard to take advantage of much of Rails' power.

The answer to the first question is most certainly yes. While knowing Ruby first would make learning Rails faster/easier, you can easily learn both at the same time. That's actually how I learned Ruby/Rails, by taking a site I had to implement first in Java and re-implementing it using Rails.


You need to know both, The RoR framework is an organizational and convenience system if you will, what it organizes is your ruby code.

If you have programmed before then here are most of your answers:
http://www.ruby-doc.org/core/
http://railsapi.com

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜