Slashdot Mirror


Rolling With Ruby On Rails

Bart Braem writes "The Ruby community is abuzz about Rails, a web application framework that makes database-backed apps dead simple. What's the fuss? Is it worth the hype? Curt Hibbs shows off Rails at ONLamp, building a simple application that even non-Rubyists can follow."

14 of 406 comments (clear)

  1. Re:Nice framework... by leonmergen · · Score: 2, Insightful

    Besides, if you do things The Right Way, when programming in OOP, the design takes a huge part of your time... and I don't really see how Java or Ruby differ in that...

    --
    - Leon Mergen
    http://www.solatis.com
  2. Re:Nice framework... by Anonymous Coward · · Score: 2, Insightful

    Wow, you obviously haven't used Rails. It *IS* much faster than Java. Hell, anything is much faster than Java.

    When you add something to Java (a new controller let's say), you have to configure it in a big XML file (with most if not all of the frameworks). Or a new template. Or a new model object. In rails you don't have to do any of that, it dynamically finds it! You literally *fly* in Rails (partly because of Rails, partly because of Ruby).

  3. Re:Good for "recipe" queries but little else by Tobias+Luetke · · Score: 2, Insightful

    This is not insightful. If you want to see how well it scales look all all the production grade applications out there. The source to hieraki is freely accessible.

    Rails is NOT your run the mill proof of concept framework. Its the next level of programming environment right now and here. Available for you to download under MIT license. The people who use it make applications magnitudes faster than the people who aren't. Single people can be as productive as whole teams.

    There hasn't been an improvement in productivity like this in recent programming-history.

    And don't just put down what you don't understand, give it a try.

    Your attitude will just get you boring jobs.

  4. Re:Nice framework... by tundog · · Score: 2, Insightful

    In rails you don't have to do any of that, it dynamically finds it!

    Thats a great concept as long as everything goes as planned. But wait until it 'dynamically finds' the wrong thing. Try debugging that nightmare. (Think VB Script + Option Explicit).

    --
    All your base are belong to us!
  5. TMTOWDI by ryantate · · Score: 4, Insightful

    Perl has its own rapid application development framework, Maypole. Here are some screenshots from a Perl.com article where Simon Cozens sets up an online sales catalog in 11 lines of code. (Here's a followup article, and the Maypole home page.)

    These systems all demo well because the developer gets to decide what functionality to demo, and it not coincidentally happens to be the functionality the framework was designed to easily support. The real test of the system comes when you want to do something the designer did not anticipate, and you find out how flexible the system is and how sensible the designer's instincts are.

    With these environments I think time will tell, with most developers watching the few willing to take the risk of investing the time needed to learn the framework and how to customize it extensively.

  6. Re:Rails is awesome by Anonymous Coward · · Score: 2, Insightful

    Oh please, not this fallacy. Just put an ad out for a Ruby programmer. Do you really think there are only about 5 or 6 in the world or something?

    And what makes you think Java or PHP or whatever is magically maintainable because the language is familiar? It takes me at least a week to get comfortable with another developer's layout, structure, conventions, etc. It might as well be a different language anyway.

    Besides, any good programmer could learn Ruby in a weekend. It's a *simple* language.

  7. Re:Nice framework... by Jerf · · Score: 3, Insightful

    I'm actually a Python partisan (like the philosophy and user base better), but the same basic thing applies to Ruby too: If your first criterion for evaluating a tech like this is "Is it written in Java/C++/Visual Basic?" or whatever other legacy language you're thinking of, you've already lost.

    Learning Python or Ruby and using it will pay off in mere weeks vs. Java, C++, Visual Basic, and most other things like that. Pay off might be a month for C#, but only if you use C# like an expert to start with. (Also, if you use C++ like a mega-expert, but even then, to use it that way you lose with the staggering quantity of typing that takes... and I mean keypresses, not object typing!)

    Ruby and Python have done everything they can short of directly downloading themselves into your brain. You have to expect to exert some effort to reap the benefits. And like I said, it pays off in mere weeks, so opportunity-cost-wise, you lose big for delaying it.

    (Note "you" here may be your company, if you only program professionally. In that case, you personally may not have any choice, but the company is still losing big.)

  8. Re:Do you know what makes me laugh? by swimmar132 · · Score: 2, Insightful

    Writing SQL statements smack dab in the middle of one's code is generally a bad thing. You want to get the code that talks to the database separated out from the rest of the application.

  9. Re:Do you know what makes me laugh? by Paradox · · Score: 2, Insightful
    Well, Rails does lots of things behind the scenes. A simple piece of code like this Object-Relational-Mapping statement:
    class Column < ActiveRecord::Base
    end
    does at the very least, the following:
    1. Pluralizes "Column" into "Columns"
    2. Finds the table "Columns" and requests its schema.
    3. Maps every column into methods.
    4. Provides logging for all SQL sent, all actions undertaken, and also allows for use of the ruby debugger on otherwise external ops
    5. Provides search and iteration methods that you'd otherwise have to write on your own
    6. Caches data for performance
    That's an awful lot of bang for your buck with just 2 lines, especially now that it's loggable and debuggable. I'd say that alone makes it better than inlined SQL.
    --
    Slashdot. It's Not For Common Sense
  10. Re:Nice framework... by Jerry · · Score: 2, Insightful
    Learning Python or Ruby and using it will pay off in mere weeks vs. Java,


    That is my experience, too.

    I attempted to build an inhouse app using Java and JDev against PostgreSQL. Where I needed to add functionality always ended up in a method which included the phrase "Generated DO NOT EDIT". I spent six months learning Java (including a class, which emphasized text editors for making gui objects. Gui by the blind ???) and attempting to build the inhouse app. I gave up in frustration.

    I decided to try Python and use Boa_Constructor against PostgreSQL. Ten weeks after I began I had learned both Python and Boa_Constructor, and had competed the app. It was 10X faster than the Java app against the same database, had all the features I had wanted to use, including reports, was easier to maintain, and MUCH easier to deploy.

    I liked the fact that ALL the files in your Python/Boa project are ASCII files and Subversion does an excellent job of version control on them. Also, the apps looks and feels the same on Linux as it does on Windows, and I had to change less than a dozen lines to make it so.

    --

    Running with Linux for over 20 years!

  11. Is that your python reimplementation? by Merk · · Score: 2, Insightful

    If so, it seems to leave the db handle, and the cursor handle dangling. That was the main point I was making, is that when wrapped in a block, these things are cleaned up for you when you're done. Other than that though, this is basically a good Python translation of what the Ruby code was doing (although the Ruby version is database-independent, I imagine Python also has a DB abstraction layer).

    Btw, how'd you get the indentation right? Manually inserting &nbsp; entities?

  12. Re:Do you know what makes me laugh? by raxx7 · · Score: 2, Insightful

    PostgreSQL at least does.

    Anyway, SQL embebbed in Python/Perl/Ruby is so simple there's nothing to gain from a SQL precompiler except static checking.

  13. Re:Nice framework... by JamesOfTheDesert · · Score: 3, Insightful
    Besides, if you do things The Right Way, when programming in OOP, the design takes a huge part of your time... and I don't really see how Java or Ruby differ in that...

    Um, yes and no. If your point is that there is a certain amount of abstract thinking required before you write any code, then yes, they will share a comon process. But, after coding in a language for a while, you tend to start thinking in the terms and abstractions the language facilitates.

    So, in perhaps the common case, Java designers will soon be thinking in terms of factories and adaptors and filters and all sort of entities that are often required in Java but which are extraneous in an agile language.

    And the time spent on those extranous objects is not time spent adressing the actual problem, but time wasted working around or through the demands of Java.

    --

    Java is the blue pill
    Choose the red pill
  14. Re:class Client ActiveRecord::Base by supavillain · · Score: 2, Insightful

    You can overwrite the default database connection method in individual classes.

    From http://rails.rubyonrails.com:

    "Connection to multiple databases in different models

    Connections are usually created through ActiveRecord::Base.establish_connection and retrieved by ActiveRecord::Base.connection. All classes inheriting from ActiveRecord::Base will use this connection. But you can also set a class-specific connection. For example, if Course is a ActiveRecord::Base, but resides in a different database you can just say Course.establish_connection and Course *and all its subclasses* will use this connection instead.

    This feature is implemented by keeping a connection pool in ActiveRecord::Base that is a Hash indexed by the class. If a connection is requested, the retrieve_connection method will go up the class-hierarchy until a connection is found in the connection pool."