SitePoint Sponsor

User Tag List

Page 1 of 4 1234 LastLast
Results 1 to 25 of 86
  1. #1
    $books++ == true matsko's Avatar
    Join Date
    Sep 2004
    Location
    Toronto
    Posts
    795
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post Benefits of Ruby?

    I am planning to purchase the new sitepoint Ruby on Rails book. I took a look at the article on the main page and read most of it, however I didn't see why ruby is so beneficial.

    Aperantly it reduces code because it incorporates a variety of libraries used for database connectivity, AJAX, and so on.

    I am not entirely sure on if this is correct (I have never used the framework before) so could someone please explain the primary benefits of the ROR.

    Thanks
    I can't believe I ate the whole thing

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    I would like to see further comment about this also. What advantages does RoR have over ASP.Net and vice versa? There are a lot of 3rd. party components available for use with ASP.Net. Are there similar components available for RoR? Is there a need for 3rd. Party components with RoR?

    Thanks,

  3. #3
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Benefits of Ruby or benefits of Rails? Two different things. I'll tackle rails though:

    1. Coding by convention - if you follow the default settings of a typical Rails app, then a lot of work is done for you. For example, if you have a class called Book that's derived from ActiveRecord::Base, it expects a database table called "books". If you have that table set up, you don't have to specify it explicitly. One less thing to write in your code, and more importantly, one less thing to test and maintain.

    2. Don't Repeat Yourself - the Rails framework makes it very easy to follow programming patterns like MVC (model-view-controller) which will help better organize and modularize your code. For exmaple, if you find that you're doing a lot of model-related things in your controller, and each controller method is doing something similar, it would be easier for you to move those methods into the model (or into another controller method, whatever works best). One place to change the same functionality app-wide. This makes for easier writing, maintenance and again, testing.

    3. Yes you can get up and running quickly with things like scaffolds and Rails plugins that add a lot of functionality to your site in little time, but that's a very small part of the larger picture.

    Now as for Ruby, it's an object-oriented scripting language with a clean syntax and a low barrier to entry. The "benefits" of Ruby, especially as it relates to whatever language you're currently using, will vary based on your needs.

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post

    Hi Vinnie,

    If RoR is as good as some say it is I would like to see more depth analysis of it in comparison to ASP.Net or other Frameworks.

    For example, what can be done with RoR that can't be done with ASP.Net (versions 1.1, 2.0, Ajax) and vice versa.

    I would like you to look at the following and then comment further.

    http://www.railsweenie.com/forums/1/topics/641?page=2

    Thanks,

  5. #5
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by mtbvfr View Post
    Hi Vinnie,

    If RoR is as good as some say it is I would like to see more depth analysis of it in comparison to ASP.Net or other Frameworks.

    For example, what can be done with RoR that can't be done with ASP.Net (versions 1.1, 2.0, Ajax) and vice versa.
    I couldn't give you a direct comparison to ASP.Net since I really don't know enough about ASP.Net to provide a fair comparison. I will say that from what I do know of .Net, the two frameworks appear to take different approaches to how a webapp should be done. Is one way better than the other? I don't know, I guess it depends on how you work and which approach you prefer.
    Quote Originally Posted by mtbvfr
    I would like you to look at the following and then comment further.

    http://www.railsweenie.com/forums/1/topics/641?page=2

    Thanks,
    It seems like a components vs partials debate. As I said, this is a differnece of approach to how a webapp should be built. In ASP.Net (again, talking from what little of the framework I know, so I may not be 100% accurate) you've got user controls which act as easy drop-in components and are reusable between different apps. In Rails there are components, but their implementation pretty much sucks so it's ignored by most serious RoR developers in favor of setting more instance variables in controllers and using partials. For reusable code across different apps, most Rails developers will extract into plugins and reuse the plugins across apps.

    Components of the type you want, and of the type most commonly found in MS development, aren't really Rails's strong point. Remember that Rails is an opinionated framework, and those opinions might not gel with everyone's way of working. It's not meant to be everything to everyone; it's meant to be good enough for most people to use and have fun with.

    If you have any followup questions I'll be happy to try and field them, but understand that I may not be too helpful since I don't have much of a .Net background to fall back on as a basis of comparison.

  6. #6
    SitePoint Guru Majglow's Avatar
    Join Date
    Aug 1999
    Location
    B-Town
    Posts
    645
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The main advantage of rails is that it's built on ruby.

    Ruby is an increadibly well designed and flexible language that in of itself reduces code. I can code stuff in ruby in a fraction of what I could do the exact same thing in PHP or C#.
    Ohai!

  7. #7
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just try Rails out! If you follow a tutorial you should be able to get a basic application up in under an hour (including installation of Ruby, Rails and MySQL). I have no experience with ASP.net, but I can compare Rails with PHP. PHP development can be reasonably fast, but if you go fast in PHP you get a mess quickly. You can go faster in Rails while creating a well designed application.

    You won't learn anything by reading a comparison article. You will learn a lot by trying it out (plus reading an article will take longer).

  8. #8
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RoR

    I would really like to believe in Ruby on Rails. I know several very competent web developers who swear it is wonderful. Unfortunately, the only thing I have to compare it to is the Visual Web Developer Express (free) from Microsoft. Because I write apps in VB and C# (.NET), it seems almost ridiculously simple to build websites using VWDE.

    The question--in what way is Ruby on Rails better? I am not asking for a duel; I really would like to know, because there must be some reason for such fervent support.
    Thanks
    Professional Race Ratings for Professional Pari-Mutuel Investors.
    www.ddssratings.com

  9. #9
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The Ruby language is much nicer than C# and VB, for example.

    Maybe you should try it out so you can get the facts yourself ;-).

  10. #10
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Pittsburgh, Los Angeles
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    because there must be some reason for such fervent support.
    Yeah, it makes you hip. There is massive amount of smugness around rails...sorta like hybrid cars (see that south park?).

  11. #11
    Awesome Addict
    Join Date
    Mar 2004
    Location
    Toronto, Canada
    Posts
    326
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mtbvfr View Post
    For example, what can be done with RoR that can't be done with ASP.Net
    Semantically correct, valid (X)HTML...


  12. #12
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fenrir2 View Post
    The Ruby language is much nicer than C# and VB, for example.

    Maybe you should try it out so you can get the facts yourself ;-).
    "nicer"? I poked around with Python awhile, and Ruby looks a lot like it. I started coding a utility app in Ruby, to "learn-by-doing," and for whatever reason, it just didn't grab me. It's OK, but so are Python and a number of others.

    For app developments, it doesn't seem a sufficient improvement over other languages (including VB) to be worth converting. Perhaps in conjunction with Rails, and for web development, it might be. That is my purpose in asking.

    What I see are a lot of enterprise accounts that subscribe to the "one-neck-to-choke" philosophy, and are pre-sold on Microsoft and ASP .NET. If there is a convincing argument that can be used to persuade them to look less skeptically on Ruby (or even Python or PHP, for that matter), it would be in the best interest of many to know what that argument could be. ("Argument" is used in the strict sense, as "a reason given in proof or rebuttal" and "discourse intended to persuade"--both straight out of Webster's)
    Thanks
    Professional Race Ratings for Professional Pari-Mutuel Investors.
    www.ddssratings.com

  13. #13
    SitePoint Zealot daveporter's Avatar
    Join Date
    Mar 2002
    Location
    Perth, Western Australia
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Traynor,

    As others have said here, I think you just have to try it yourself to get a feel for RoR.

    It depends on what your needs are? what your requirements are ? And what you feel comfortable with ? It may not be for everyone, but only you can determine that.

    If I wanted a new car I would not ask people what it 'feels like' to drive the latest and greatest model 'XYZ'. I would go out and take it for a test drive myself.

    Instant Rails is a simple install that can have you up and running in no time. Then work through two or three of the many introductory tutorials & get a feel for it yourself ! Then make a decision on if it has potential for your requirements.
    ( http://instantrails.rubyforge.org/wiki/wiki.pl )

    cheers - Dave Porter
    Last edited by daveporter; Feb 11, 2007 at 16:13. Reason: Typo

  14. #14
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Pittsburgh, Los Angeles
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it would be in the best interest of many to know what that argument could be.
    You rarely find people making arguments for languages/frameworks, its sorta like a religion in that regard. Instead you get things like "try it yourself", which aren't very helpful. After all doing small little tutorials tell you little about how the language/framework works in more realistic examples. And why move to a new technology for a project if you don't have solid reasoning for the move?

  15. #15
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    We can of course give random examples, but if you give us more information of the types of websites you want to create we can give specific examples.

    Random example:

    Code:
    class Category < ActiveRecord::Base
      acts_as_tree
    end
    
    programming = Category.create(:name => 'Programming')
    ruby = programming.children.create(:name => 'Ruby')
    php = programming.children.create(:name => 'PHP')
    rails = ruby.children.create(:name => 'Rails')
    This creates a category tree (it's stored in a database table called `categories`).

    You can use it like this: (#=> means "returns")

    Code:
    category = Category.find_by_name('Ruby')
    category.children #=> [#<Category:0xb70a83ec @attributes={"name"=>"Rails","id"=>4,"parent_id"=>2}>]
    Note that you get a rich and easy to use API with just 1 line that says `acts_as_tree`.

    Code:
    class Category < ActiveRecord::Base
      acts_as_tree
    
      has_many :books
    end
    
    class Book < ActiveRecord::Base
      belongs_to :category
    end
    
    agile = rails.books.create(:title => 'Agile Web Development with Rails', :author => 'Dave Thomas')
    sitepoint = rails.books.create(:title => 'Build Your Own Ruby On Rails Web Applications', :author => 'Patrick Lenz')
    pickaxe = ruby.books.create(:title => 'Programming Ruby', :author => 'Dave Thomas')
    
    agile.category #=> #<Category..."Rails"...>
    
    rails.books.find_by_author('Dave Thomas') #=> #<Book... "Agile Web Development With Rails">
    ruby.books.find_by_author('Dave Thomas') #=> #<Book..."Programming Ruby">

  16. #16
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Snaily View Post
    You rarely find people making arguments for languages/frameworks, its sorta like a religion in that regard. Instead you get things like "try it yourself", which aren't very helpful. After all doing small little tutorials tell you little about how the language/framework works in more realistic examples. And why move to a new technology for a project if you don't have solid reasoning for the move?
    How is trying out a new framework not helpful? You can read all the books, articles, and blog posts in the world about something, think you like it, and still end up hating it once you start banging out code. Ruby has a low enough barrier to entry that someone can install it and start playing with the interpreter in a few minutes. Hate ruby after that? Fine, just uninstall it! Keep working on your C# projects or whatever you were doing before you heard of Ruby.

    Yes, "try it yourself" may not be helpful for someone who wants a list of benefits and drawbacks in a nicely formatted PDF to download and give to their boss, but we're not here to do other people's research and analysis either. Even if we could do that analysis, we have no idea about the particulars of the person's business or whatever, so we don't know what benefits and drawbacks will apply to him/her.

  17. #17
    SitePoint Zealot daveporter's Avatar
    Join Date
    Mar 2002
    Location
    Perth, Western Australia
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Beautifully put Vinnie !

  18. #18
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Pittsburgh, Los Angeles
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How is trying out a new framework not helpful?
    It depends what you mean by "trying it out". If I was to try it out on a large project, that may be helpful. But the point is, I don't want to waste my time doing that unless I have at least some sort of rationally basis for using it. On the other hand doing little tutorials doesn't show you much (They are always made in a way to make the framework look good). Anyhow, this isn't also about trying to convince your boss. When I first started doing web work I looked around at all the available technologies....I wasn't going to spend days working with each one to see which one I liked best. Rather, I read about the benefits of each platform and then tried out maybe 3 of them (I tried Java, PHP and Perl/mod_perl). I didn't try out Rails/Ruby because Ruby is just too damn slow for what I'm doing.
    Even if we could do that analysis, we have no idea about the particulars of the person's business or whatever, so we don't know what benefits and drawbacks will apply to him/her.
    I think the guy was just asking for an actual argument and not the typical hype that comes from rails users.... You did outline a few benefits but that was the closest thing to any sort of rational basis for using Rails that was mentioned. Anyhow, if rails is to succeed then someone is going to need to outline rationally what the benefits are....nobody seems to be doing this. Every post I see like this ends the same way "Ruby is just so great...", "Just try it".

  19. #19
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Snaily View Post
    It depends what you mean by "trying it out". If I was to try it out on a large project, that may be helpful. But the point is, I don't want to waste my time doing that unless I have at least some sort of rationally basis for using it. On the other hand doing little tutorials doesn't show you much (They are always made in a way to make the framework look good). Anyhow, this isn't also about trying to convince your boss. When I first started doing web work I looked around at all the available technologies....I wasn't going to spend days working with each one to see which one I liked best. Rather, I read about the benefits of each platform and then tried out maybe 3 of them (I tried Java, PHP and Perl/mod_perl).
    Yes trying all technologies out will take long if you do a non-trivial project. On the other hand, you could implement part of your project using the technologies. Because you're doing the same thing with different languages you can easily compare them. But you'll have to filter your options because there are too many. Maybe this helps: Rails makes these things easy: database access, clean urls, views (templates). Ruby: clean object orientation (Ruby's somewhere between Java and Smalltalk), string handling, good array library (each/select/reject/map/grep/zip), interactive/incremental development. This is by no means a complete list, maybe others can add?

    I didn't try out Rails/Ruby because Ruby is just too damn slow for what I'm doing.
    May I ask what you are doing?

    I think the guy was just asking for an actual argument and not the typical hype that comes from rails users.... You did outline a few benefits but that was the closest thing to any sort of rational basis for using Rails that was mentioned. Anyhow, if rails is to succeed then someone is going to need to outline rationally what the benefits are....nobody seems to be doing this. Every post I see like this ends the same way "Ruby is just so great...", "Just try it".
    Is this list I gave above the type of argument you're looking for?

  20. #20
    Web developer Carl's Avatar
    Join Date
    Sep 2003
    Location
    sweden
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have just finished going through the "Programming Ruby" book and as I sit here with the ASP.NET 2.0 unleashed book in one hand and the "Development with Rails" in the other I can make one large comment on the difference.

    When you are learning ASP.NET you are also learning VB or #C. The language can be seen as being seperate from the framwork as you code. This is not true for Rails. When you are doing Rails you are not learning Ruby. You learn the syntax but not the language itself. So you can expect to see Rails enthusiast also wanting to learn the Ruby language through other books and sources.

  21. #21
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, you can code Rails applications without really understanding Ruby. This is why some people call Rails a "Domain Specific Language": you write configuration files (which just happen to be valid Ruby code) that specify your application. It's "Domain Specific" because it's for web applications. But if you want to do interesting things with Rails you really have to learn Ruby.

  22. #22
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, you can code Rails applications without really understanding Ruby.
    Having had to work on some inherited Rails projects in the past year, I'd have to disagree with that.

    Sure, you can probably knock something basic out with only a rudimentary understanding of Ruby but if you try anything a bit more complicated it will likely turn out to be a mess.

  23. #23
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Pittsburgh, Los Angeles
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    May I ask what you are doing?
    I work on a lot of algorithms (yes on the web) and currently all the stable ways to run Ruby are pretty slow.
    Is this list I gave above the type of argument you're looking for?
    I'm not the one that asked, I just starting reading the thread because I was interested in what people would say. But for me a list of good things about Ruby isn't an argument. I would want to see some sort of analysis that compared Ruby to other technologies and additionally highlighted both the positive and negative aspects of developing with Ruby.

  24. #24
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Ryd
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Snaily View Post
    I work on a lot of algorithms (yes on the web) and currently all the stable ways to run Ruby are pretty slow.
    Are you using FastCGI?

  25. #25
    SitePoint Wizard
    Join Date
    Jul 2004
    Location
    Minneapolis, MN
    Posts
    1,924
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sure there are some technical benefits to using Ruby, or perhaps disadvantages. I am not really well-versed in this area. However, the only reason I would ever use Ruby would be for Ruby on Rails.

    I really have an interest in Ruby on Rails because it is much easier to actually build something effectively and it makes the code much simplier. I also really like the syntax of Ruby in general. Rails applications are much easier to maintain and update.

    However, the PHP community's response to Rails really has been good too with frameworks like Cake and such.


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
  •