SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Evangelist
    Join Date
    Apr 2006
    Location
    Halifax, Canada
    Posts
    498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ruby / RoR for PHP programmers?

    I am a PHP programmer and I have been wanting to start learning Ruby on Rails for a while now. I have found a ton of Ruby tutorials, but I have been surprised that I haven't been able to find any that were geared for people who had experience in PHP. Surly many Ruby programmers started as PHP programmers, so there must be a good tutorial or book on the subject?

    On a related topic, is it better to learn Ruby and then Ruby on Rails, or both at the same time?
    Paul Butler.org
    JSSpamBlock - Reduce WordPress spam.

  2. #2
    SitePoint Guru Majglow's Avatar
    Join Date
    Aug 1999
    Location
    B-Town
    Posts
    645
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I came from PHP (and C, C++, C#, Java, etc...) and just used the programming ruby book. Since I was already quite familiar with programming concepts, I pretty much just skimmed through to get a grasp on syntax and "rubyisms"

    And yes, I would definitely say learn ruby before tackling Rails since the later is a framework built on Ruby.
    Ohai!

  3. #3
    Web developer Carl's Avatar
    Join Date
    Sep 2003
    Location
    sweden
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have just done a few articles/tutorials and found a few that needed a new home to get noticed. I believe that the articles are perfect for a PHP programmer looking to get going in Ruby , because that's me. I have also tried to make sure that things work on a Windows development PC as well as a shared hosting environment. And no Rails!

    I hope once you read them that you will be as excited about Ruby as I now am. You'll have to check the sig since we are not allowed to link home.

  4. #4
    SitePoint Evangelist
    Join Date
    Apr 2005
    Posts
    485
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paulgb
    I am a PHP programmer and I have been wanting to start learning Ruby on Rails for a while now. I have found a ton of Ruby tutorials, but I have been surprised that I haven't been able to find any that were geared for people who had experience in PHP. Surly many Ruby programmers started as PHP programmers, so there must be a good tutorial or book on the subject?

    On a related topic, is it better to learn Ruby and then Ruby on Rails, or both at the same time?
    if you are just learning w/o any strict deadlines, i'd recommend learning ruby first - unless you have an incredible ability to assimilate information in a meaningful way.

    i programmed in php - which is typtically procedural in nature. to go ruby, you need to learn a new language *and* a new program approach - OOP.

    then you need to learn rails' structure and conventions.

    it is a *lot*, so don't expect instant results.

    the pragmatic programmer ruby and ruby on rails books are very good.

    i also found this tutorial to be helpful b/c it introduces ruby in a way that is similar to how much of php is coded - procedural in nature.

    http://www.troubleshooters.com/codec...ar_Expressions

    it isn't a classical ruby tutorial, rather, it is a perl programmer's using ruby in a procedural way. this isn't where you want to end up, but it *is* nice to learn about ruby in familiar territory before delving into OOP. the author makes this clear early on and provides a link to some OOP goodness, although i haven't checked it out yet.

    once you get the ruby flow... you can then make the leap to the "ruby way" once you have the syntax base down.

    in the end, you must attack it the way that works best for you.

    good luck.

  5. #5
    SitePoint Evangelist
    Join Date
    Apr 2006
    Location
    Halifax, Canada
    Posts
    498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks everyone. I have read a couple tutorials on Ruby, and I am starting to get started with InstantRails (which I learned about through Carl's excellent site).
    Paul Butler.org
    JSSpamBlock - Reduce WordPress spam.

  6. #6
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    The problem is that Ruby does really want to behave like PHP at all. Have you built an PHP5 application using OOP practices? Because that is more akin to Ruby. Ruby doesn't want to be the procedural / functional style which PHP is known for. If your serious about Ruby, I suggest you try to unlearn your PHP habits rather than force Ruby into something it doesn't want to do.

    Helpful Books to learn from:

    http://www.amazon.com/gp/product/097...754263?ie=UTF8
    http://www.amazon.com/gp/product/097...754263?ie=UTF8
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  7. #7
    SitePoint Evangelist
    Join Date
    Apr 2005
    Posts
    485
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by The New Guy
    The problem is that Ruby does really want to behave like PHP at all. Have you built an PHP5 application using OOP practices? Because that is more akin to Ruby. Ruby doesn't want to be the procedural / functional style which PHP is known for. If your serious about Ruby, I suggest you try to unlearn your PHP habits rather than force Ruby into something it doesn't want to do.

    Helpful Books to learn from:

    http://www.amazon.com/gp/product/097...754263?ie=UTF8
    http://www.amazon.com/gp/product/097...754263?ie=UTF8
    i totally agree.

    however, in my case, i'm working on an app to get it up and running. i'm using procedural techniques b/c that is what i know. sure, i've read some ruby style code and i get it to an extent, but it isn't internalized.

    once i get my app running, though, i will refactor it into ruby style bliss.

    i think this process will help me to code my next app in ruby style from the beginning.

    i definitely agree that hacking ruby into a procedural language is a total waste if that is one's end goal.

  8. #8
    SitePoint Evangelist
    Join Date
    Apr 2006
    Location
    Halifax, Canada
    Posts
    498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the tips. Here is the approach I have taken so far:



    So far, I have found the learning very smooth and I am very impressed with what Ruby on Rails can do. I would like to get a good Rails book, but I am not sure if I should go with Agile Development with Ruby on Rails, Programming Ruby, or wait till Sitepoint's book comes out later this year.
    Paul Butler.org
    JSSpamBlock - Reduce WordPress spam.

  9. #9
    SitePoint Zealot
    Join Date
    Jul 2005
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Agile Web Development with Rails - Not a bad book, but the do this and then do that approach to building the depot wasn't form me. Though it did give me a crash course in debugging, I mainly use it along with the Rails API for reference now. It's currently in beta for it's second edition, the beta is available to all customers.

    Programming Ruby - Not a bad book, I've read through it from cover to cover twice now and I still find something new every time. That along with Ruby-Doc and I'm usually able to figure out whatever it is that I'm wondering about.

    Ruby for Rails - I really liked this book. It teaches you about the almost DSL like uses of Ruby in Rails, along with some of the more common uses of Ruby in Rails to get you up and running fast. Since I've read it I've only picked it up one other time, but the initial read definitely makes it worth the money in my opinion.

    Rails Recipes - Alright, I just wish that it was bigger then 299 pages.

    Ruby Cookbook - This book is huge and informative at 941 pages. Since I joined the Rough Cuts program it hasn't left my side.

    If I had to do it all over again, I would read part one of Programming Ruby first (165 Pages). Then I would move on to Ruby for Rails and then Agile Web Development with Rails. After that Programming Ruby and Agile Web Development with Rails would serve as killer references.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •