Is it better to learn Ruby before Rails?

Inspired by another post: I know many Rails developers who know and can use Rails very well but don’t really know Ruby. I recently worked with a seasoned Rails developer who didn’t realise that attr_accessor is just a class method called within the class, (a.k.a class macro). The same went for Rails routes. He was under the impression it was some kind of Rails ‘magic’ and I suppose he was right in a sense but -under the magic- it;s just plain, old Ruby.

My point is: Do you think that devs should learn Ruby first? Do you think it doesn’t make a difference as long as they know Rails? If you could go back in time, would you have learned Ruby before Rails?

My take is this: learning Ruby makes people better Rails developers. I strongly recommend, if you’re contemplating doing Rails for the first time, to dedicate some time to get up to speed with Ruby first. It will save a lot of pain and hassle in the long run.

1 Like

Completely agree with you Fred - Ruby is so easy to pick that it just makes sense to read at least one book on it first.

Are there many developers who only know Rails? Around South Wales too? If you had to guess a percentage - what would you say? (Of all Rails devs not just those in Wales.)

Going on all the Rails devs I’ve worked with in the last few years, I’d say about 40% don’t know Ruby beyond what they learn through Rails. This may sound shocking but -if you think about it- they can be very productive writing standard Rails apps, i.e. database with some business logic, some single-model forms and a nice UI. It’s when they try to go off the beaten track that they get into trouble.

1 Like

I guess many these days turn to Stack Overflow for answers - reckon that plays a part?

I remember when I first started out and I was asking loads of questions in the Rails Chat room, Ryan Bigg recommend I learn Ruby - he said he started out like me and that Ruby was easy. He also recommended ‘The Well Grounded Rubyist’ which is now one of my favourite Ruby books - it’s brilliant for beginners and I am grateful that he pushed me into learning it :slight_smile:

Absolutely agree with you- this is a huge gap of knowledge for a lot of people. The Rails DSL is so heavy that you can put together even fairly complex applications with hardly any understanding of Ruby or backend programming at all, which probably helps with it’s widespread popularity.

I think it’s essential to understand at least the basics of what’s happening ‘under the hood’ of Rails. You can’t make informed decisions without knowing why conventions are in place, and why it’s sometimes necessary to break convention to build the best app for your situation. Especially for complex Rails configurations when you have extra security needs, custom gems, or heavier testing demands, a lot of proper Ruby knowledge can seriously damage your ability to build the proper application.

2 Likes

Yes, I suppose people only pick what they need to solve a specific problem and ignore the rest. It’s the Twitter generation: information overload and the attention span of a gnat :laughing: . I like to get a more holistic view on things. I got interested in Ruby through Rails, but then I took some time to learn Ruby first before going back to Rails. I firmly believe it made me a better programmer, in Rails and generally

PS: yes, the .Well Grounded Rubyist is a Ruby classic, a bit dated now but still v.good.

1 Like

surely, you meant ‘a lack of’ ?!

how can i learn Ruby ? any recommended tutorial for me ? Actually i have experience in another programming language (PHP) but not impressive too. And i want to learn Ruby but didn’t know where i strart from.

1 Like

Yes.

Knowing any general programming may permit some one to start learning Rails, but with not knowing anything about programming; Rails is the last thing you should endeavor to learn. Learning the basics are key to anything. Mastering the basics is the ideal in development. Going above and beyond the basics will lead to masterful work.

Learning a framework like Rails without knowing basic programming in Ruby is like holding a hammer by the wrong end to drive a nail.

@nickiesiva I would recommend RubyMonk.com : Ruby Primer to “walk the path of enlightenment”. It’s an interactive learning site.

4 Likes

Oke i’ll try it.

as well as what @danielpclark wrote, I’d also suggest the jumpstart tutorials. I’ve actually written a blog post on the subject (if AJ permits me some self-advertising :wink: )

2 Likes

If you want a very prescriptive guide, check out my own post here: http://astonj.com/tech/best-way-to-learn-ruby-rails :smile:

Btw @RedFred7, it’s totally fine for regular members like you to mention your own stuff (its just those who sign up purely to advertise that we frown upon). Also of note, when you hit trust level 3 any links you post get the automatic nofollow removed :wink:

1 Like

I read through that post a while back and it’s pretty useful. There are a ton of good resources there.

@nickiesiva: I strongly recommend finding some other beginner students that you can keep in touch through your studies. Fellow beginners help provide great community, stress relief, and you can help each other through some tough parts. Many people learn a great deal more effectively if they’re doing so in tandem with another student or a few of them.

it’s good to know AJ. All I have to do now is get trust level 3. Who do I have to kill?

1 Like

Not me! Lol

1 Like

Don’t worry, if I did there’d be no-one to give me trust level 3 :grinning:

Well strictly speaking, not really :stuck_out_tongue: (The system does the promotions/demotions automatically)

I’ll post a thread up detailing Trust Levels later :wink:

1 Like

@nickiesiva, as mentioned in this thread, the ‘The Well-Grounded Rubyist’ book is an excellent resource.

This is even more important if you lack familiarity with OO principles. That book will help a lot in that direction. Seriously, David Black is an awesome author!

2 Likes

I learn Rails before Ruby but then I realize that I should have learned Ruby before rails.

Right now I am training interns and existing team from 3 years now. By experience and experiments I have learned that learning ruby before rails make developer very effective.

Check this post from Justin Weiss which will give a fair idea whether to dive directly in Rails or to have a basic knowledge of Ruby.

2 Likes

The path I took was:

  1. Ruby
  2. Sinatra
  3. Rails

Sinatra is a great stepping stone into web development.

3 Likes