SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow Learning Ruby on Rails? is it worth it

    Hi Everyone,

    Ive been in the website development game for 10 years, and am currently working in PHP, have worked in CF previously.

    Just wanted to know if it is worth learning RoR? My boss has suggested that it would be a good thing to do but i have nothing to really go on. so i though id ask here?

    Is it easy to cross over to?, easy to use? easy to debug?

    I am self taught so any help would be greatly appreciated..

    Thanks

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,454
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)
    Is learning RoR "worth" it?
    Quote Originally Posted by datswicked
    My boss has suggested that it would be a good thing to do
    If a change is in the works you may want to get on board so you don't get left ashore.

    IMHO, there are lots of similarities between PHP and Ruby, you should do fine. Especially if you understand and can work with OOP. As for Rails, if you have any experience with MVC you should likewise do fine with that.

    If you have experience working via the CLI as opposed to only GUIs that's a plus. Although some IDEs have Ruby integration so that may be an option too.

    In any case, it's free and will only cost you some time to try it and see if it's for you or not. The tricky part (for me anyway) was getting everything installed and configured on my computer so I could experiment with it and work through several tutorials.

    I don't have much experience with debugging other than looking through the log files and running the unit/functional/integration tests. But there are other debugging capabilities available, I just haven't got into them yet.

  3. #3
    SitePoint Member
    Join Date
    Apr 2009
    Location
    Australia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by datswicked View Post
    Just wanted to know if it is worth learning RoR?
    It is so worth learning Rails! Even if you don't end up writing Rails in your day job, Rails will teach you many best practices that you'll soon miss when not working in Rails.

    Quote Originally Posted by datswicked View Post
    Is it easy to cross over to?, easy to use? easy to debug?
    I'm sure you won't have any problems, especially with 10 years industry experience and an ability to self teach. There's not usually a need to debug beyond echo/printf.

    If you buy an introductory Rails book, try it for 3 weeks, and regret the experience - I'll buy the book off you at your purchase price

  4. #4
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's very worthwhile. I love it so much more than anything I've used in the past. By "it," I mean both Ruby and the Rails framework.

    Recommended tools to use with it:
    • RSpec for BDD/specs
    • RSpec on Rails for additional RSpec matchers and helpers to work with Rails
    • Cucumber for integration testing and writing scenarios
    • Webrat for simulating the browser in integration testing and view specs
    • rails.vim for Rails in vim


    As for books about Ruby, the first I came across when I was learning it, but still something I enjoyed immensely, was the free book Why's (Poignant) Guide to Ruby.

    I also recommend The RSpec Book. It's a good introduction to both RSpec and Rails.

    Another good book was Simply Rails 2 from SitePoint. However, I thought testing was mostly an afterthought in most chapters, and I prefer RSpec over Test::Unit.

    Also recommended to take a look at the Rails source, as I find it's easier to see what's going on, and sometimes is clearer than the API docs. Certainly a healthy dose of both is good for figuring out whatever you're trying to do. It's really not that hard once you know where to look, or you can use tags in vim to jump around rather easily.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  5. #5
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi All,

    Thanks for your replys, much appreciatea and thanks devbanana for the links etc..
    I have bought the sitepoint Simply Rails 2 Book and will dive in asap..

    I hope its as easy as it sounds..

  6. #6
    SitePoint Enthusiast
    Join Date
    Jan 2008
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm quite enjoying it at the moment although I'm starting on the same journey as you. I come from the same background as well.

    There was a lot to get my head round including installation, MVC and the Active Records. The thing which knocked me back was because I got the Rails book and 2.0 had just come out. I got frustrated and sacked it off as the examples in the book did not quite work.

    I also found rake commands a bit confusing and have since just been sorting my database out through a GUI to avoid it. I guess for a design box its not too much a big deal to scrap a database and quickly rebuild it. Anyway...

    I came back three weeks ago for another go and thanks to a mate have got started and the rest of the book is still valid. It isn't as easy as it makes out but a lot of that is simply down to learning the syntax and the rails way of working. Once you've got that its very rewarding. A lot of the php stuff is still valid (like looping out your records and checking to make sure variables are what you expect them to be etc).

    I'm just converting my old site to a rails powered one at the moment. Once you get cracking it does speed you up and keeps things organised. I'm really looking forward to building upon the basics I've picked up in the last few weeks.

    Everyone here is really helpful as well when you want stray away from the book.

  7. #7
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thansk TDFM,

    So is there still PHP in there? or is it all totally new syntax?

  8. #8
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by datswicked View Post
    Thansk TDFM,

    So is there still PHP in there? or is it all totally new syntax?
    No, it's a totally different language. If you're asking if the syntax is similar, then yes it is, in some regards, but different in others. It's not that hard, though.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  9. #9
    SitePoint Enthusiast
    Join Date
    Jan 2008
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for the confusion. The syntax isn't the same but a lot of the principles from php web apps are still more than valid IMO.

  10. #10
    SitePoint Enthusiast
    Join Date
    Sep 2007
    Location
    San Jose
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been considering learning RoR or CodeIgniter.

    Which one is easier to learn? Would CodeIgniter be worthwile?

    I don't have a specific requirement for any other than trying to learn how to build more powerful websites with more flexibility and in less time.

    Thanks

  11. #11
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by JIAM View Post
    I've been considering learning RoR or CodeIgniter.

    Which one is easier to learn? Would CodeIgniter be worthwile?

    I don't have a specific requirement for any other than trying to learn how to build more powerful websites with more flexibility and in less time.

    Thanks
    I would go with RoR, mostly because it has so many useful, and in my opinion necessary, tools that PHP really doesn't have, such as the tools I linked to in my first post. It is rather easy to get started in, too, and simple to deploy. To me, Ruby is much mor eintuitive than PHP.

    There are several things in Ruby that just would take more work in PHP. In PHP, it feels like OO has just been hacked into the language. They try to fix that a bit in PHP5 but it doesn't negate the mess created in the previous versions.

    In contrast, in Ruby, absolutely everything is an object. It makes it much more intuitive to work with the language, because objects are an integral part of the language.

    Also, I love blocks/procs/closures.

    Example:

    [
    Code:
    (1..10).select { |num| num % 2 == 0 }
    #=> [2, 4, 6, 8, 10]
    Or:

    Code:
    (1..10).to_a.delete_if do |num|
      num > 3
    end
    #=> [1, 2, 3]
    Sorting is very flexible:

    Code:
    class Widget
      attr_accessor :name, :price
      def initialize name, price
        self.name, self.price = name, price
      end
    end
    
    def print_widgets widgets
      widgets.each do |widget|
        puts "#{widget.name}: #{widget.price}"
      end
    end
    
    # Creating some widgets
    widgets = []
    widgets << Widget.new('Foo', 4.99)
    widgets << Widget.new('Bar', 2.98)
    widgets << Widget.new('Baz', 9.99)
    
    print_widgets widgets
    # Foo: 4.99
    # Bar: 2.98
    # Baz: 9.99
    
    # Sort by price
    widgets.sort! do |w1, w2|
      w1.price <=> w2.price
    end
    
    print_widgets widgets
    # Bar: 2.98
    # Foo: 4.99
    # Baz: 9.99
    ]

    Another cool thing is that you can extend classes. I don't know the proper word for it. I don't mean inheritance, but you can actually add methods to an existing class.

    Code:
    class String
      def foo
        puts 'I am foo. I have infultrated String.'
      end
    end
    
    "hello".foo
    # Outputs: "I am foo. I have infultrated String."
    There are also mixins, the ability for classes to include and extend modules.

    Code:
    module Foo
      def do_something
        puts "I am doing something."
      end
    end
    
    module Calculator
      def add a, b
        a + b
      end
    end
    
    class Bar
      include Foo
      include Calculator
    end
    
    bar=Bar.new
    bar.do_something
    # Outputs: "I am doing something."
    bar.calc 1, 2
    #=> 3
    And it continues, but i've been working on this post for like an hour.

    Of course, that's only Ruby, and I haven't discussed anything from Rails, which is really great in its own right. There are frameworks inspired by Rails in PHP, but Rails does everything much more elegantly.

    If nothing else, I think you should learn it just for the experience of another language. I don't think there's ever harm in learning a new language and perspective on programming.

    Hope that helps.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  12. #12
    SitePoint Zealot superjacent's Avatar
    Join Date
    Jun 2007
    Location
    Melbourne, Australia.
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm currently in the process of re-learning Ruby, not that I really knew it before, but I reckon understanding the in's and out's of Ruby must be a big plus to then be fiddling with Rails. My goal is to web develop using Rails or at least a Ruby based framework.

    I can't comment about PHP as I never really could get into it. I'm sure if I spent the time with PHP things would make sense, it's just that I think my time is better spent understanding Ruby and RoR as I still want to develop desktop applications.

  13. #13
    SitePoint Enthusiast
    Join Date
    Sep 2007
    Location
    San Jose
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @devbanana:
    Wow! Thanks for your post, this is great!


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
  •