Topic: Seasoned PHP Developer switching to RoR - how much time to learn?

Hi Everyone,

I'm a seasoned PHP Developer with experience in C# and VB as well.  I'm a heavy OO developer.  We are developing a new app that has social elements as well as heavy database requirements.  Just looking at RoR, I like the readability and elegance of the code.  I'm also thrilled with the ability of videocasts, community involvement, and online materials.

Question for you Rubyist:
How long do you think it will take a PHP developer to transition to Ruby, with the parameters of being able to code well enough to be productive?

Cheers,
Whit

Re: Seasoned PHP Developer switching to RoR - how much time to learn?

That's impossible to answer, everyone learns at different paces.
If you need to learn FAST then get AWDWR http://pragprog.com/book/rails4/agile-w … with-rails and work through the depot app, it'll probably take 2 or 3 passes to get it and then you'll be pretty productive, certainly able to get a professional app well under way as you have a head start.

As an experienced desktop dev it took me 3 passes to get going but I had a much steeper learning curve than you are going to have as I had no web development experience.

What you want and what you need are too often not the same thing!
When your head is hurting from trying to solve a problem, stop standing on it. When you are the right way up you will see the problem differently and you just might find the solution.
(Quote by me 15th July 2009)

Re: Seasoned PHP Developer switching to RoR - how much time to learn?

Thanks James.

I got a copy of the book yesterday.  First, I'm also spending a couple of days going through the videocasts at lynda.com, just to give me a good base before I dig into the book.  I learn best via video supplemented with text.

Cheers,
Whit

Re: Seasoned PHP Developer switching to RoR - how much time to learn?

O.K., I've not seen those.
My sources are
1) AWDWR, 
2) Railscasts http://railscasts.com
3) Rails docs http://api.rubyonrails.org/
4) Programming Ruby http://pragprog.com/book/ruby3/programming-ruby-1-9
5) The log files wink - learning how to read your log files is the biggest help you will get.
5) Stack Overflow.

Best piece of advice I can give you, don;t fight it! It's too temptiong to do things your way rather than the Rails way. If you learn what Rails expects you to be doing it's a breeze smile, a common truism in the Rails world is "If you are finding it difficult, you are doing it wrong"

My light bulb moments were
1) Forms - Realising that forms (form_for ... |f|, form_tag etc...) are rails way of defining the url that a form is posted back to and the stuff that gets attached to the form (f.something) is Rails way of conveniently defining the parameters that get passed back to a controllers action in the params hash

2) The log files are your friend.

3) accepts_nested_attributes and fields_for for capturing data for more than one table (model) at a time.
accepts_nested attributes means exactly that! Defining accepts_nested_attributes for model_2 in model_1 class means that params hash attributes for model 2 that are nested inside the params hash for model_1 (by using fields_for in yout view layer) will automatically cause model_1 to update or create the associated records for model 2

4) Rails is a 3 tier system where the views and controllers form the first tier containing all the view logic, models form the 2nd tier containing all the the business logic with the database obviously being the 3rd tier.

5) When starting out I felt that I wanted to get to the point of "hand crafting" rather than generating my models, controllers etc... when actually hand crafting gives you 10 times the amount of work to do smile

6) Testing is easy and essential as Ruby is an interpreted language not compiled. AWDWR deals with testing extremely well but I also foun this railscast to be totally inspirational http://railscasts.com/episodes/275-how-i-test

Good luck and welcome to the world of rails

What you want and what you need are too often not the same thing!
When your head is hurting from trying to solve a problem, stop standing on it. When you are the right way up you will see the problem differently and you just might find the solution.
(Quote by me 15th July 2009)