Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming The Internet IT Technology

Ruby on Rails 2.0 is Done 385

Jamie noted that ruby on rails 2.0 is done. In addition to upgrade and installation instructions, the article lists a number of the more interesting new features in the release which appears to be quite extensive.
This discussion has been archived. No new comments can be posted.

Ruby on Rails 2.0 is Done

Comments Filter:
  • Fresh Meat! (Score:2, Interesting)

    by TechyImmigrant ( 175943 ) * on Saturday December 08, 2007 @01:30PM (#21624991) Homepage Journal
    Fresh Meat, full of bugs, for the hackers to hack.

    If you desire a secure system, do not place a large, immature body of code in the line of fire on the internet.

  • by Russ Nelson ( 33911 ) <slashdot@russnelson.com> on Saturday December 08, 2007 @01:36PM (#21625039) Homepage
    I don't understand the fuss behind Ruby on Rails. Ruby is a programming language. Rails is a framework. Frameworks are a dime a dozen. Is RoR all that wonderful or are we being marketed-to?
  • Re:Compound Keys (Score:2, Interesting)

    by poet ( 8021 ) on Saturday December 08, 2007 @01:42PM (#21625089) Homepage
    I doubt it.. Rails has never been known for actually using the database for more than a flat file... One of the reasons it can't scale.
  • by markmcb ( 855750 ) on Saturday December 08, 2007 @01:43PM (#21625095) Homepage
    OmniNerd.com [omninerd.com], a site I do hobby development for, is running on Rails 2.0. We switched over from PHP this fall and site maintenance has been a dream since. Our site has even survived a few Slashdottings and Diggs since the switch, which used to murder it before. (Granted, the PHP code wasn't the best.) I've heard the "doesn't scale" debate a million times, but I'm curious if there is anyone out there who has recently moved a project from one language/framework to Ruby/Rails and whether you're glad you did or if it's been a nightmare. We're a medium-to-low traffic site with big surges every few weeks and it's worked well for us.
  • by FooBarWidget ( 556006 ) on Saturday December 08, 2007 @02:00PM (#21625251)
    "Sure, but that's because Ruby is a real VHLL. You could also have achieved that effect by switching to Perl or, if you don't mind thinking in object-oriented terms about absolutely everything (and can put up with syntactically significant whitespace), Python. That doesn't answer the question about Rails."

    Uhm no I don't. I've programmed in Perl far longer than I've programmed in Ruby. I only started with Ruby about 2 years ago. I have experience with mod_perl and stuff like Template Toolkit. I have experience with Python. And Ruby on Rails *still* beats everything else I've used.

    It isn't just Ruby, it's also Rails. It's the entire package. Rails is not just any framework, it's an entire design philosophy. It's opinionated software. It's Don't-Repeat-Yourself. It's REST. It's convention-over-configuration. All this stuff together makes me much, much more productive. Ruby on Rails actually makes web application programming more fun than desktop application programming.
  • Re:ORM still broken? (Score:5, Interesting)

    by thammoud ( 193905 ) on Saturday December 08, 2007 @02:22PM (#21625449)
    A DBA that uses composite primary keys does not deserve the title. You should never designate a primary key whose value can change. Use business keys for that.
  • by pestilence669 ( 823950 ) on Saturday December 08, 2007 @02:23PM (#21625463)
    "Web guys" will never understand the hype behind RoR. For the average PHP coder, RoR is slower and more restrictive... A hindrance. To a software engineer, however, RoR's great use of design patterns and best practices compliments what they should be doing already. Just as an example, if you're not writing unit tests, then you aren't very serious about your software to begin with. RoR's test facilities will bore you and nag you death. What Rails does is force you to consciously decide to not do something you should probably be doing, like testing. If MVC and encapsulation mean nothing to you, then RoR can't help you much. You still need you own discipline, or you can still write abominable code. RoR embodies many practices from how the big boys write software, few from the basement hackers.
  • Re:ORM still broken? (Score:3, Interesting)

    by Anonymous Coward on Saturday December 08, 2007 @02:27PM (#21625495)
    Getting a *PROGRAMMER'S* opinion on data modeling is probably not a good idea. The view everything as objects or records, which is what they use in their programming. That's a subset of what the relational model allows.

    Here's the simple, easy-to-comprehend reason why surrogate keys should not be used universally: Your logical model should exactly correspond to the client's conceptual model.

    If the client says that "orders have order items, numbered 1,2,3,4..." then your model should have (ORDER#, LINE#) as the compound key for order items. If the client says "customers are identified by an arbitrary customer number", then it's okay to use an artificial ID. If the client says "customers are identified by SSNs" then that's your key.

    Pretty simple concept, but completely lost on programmers who think the database is the "backing store" for their code (which will likely be replaced or rewritten in few year anyway, especially stuff like PHP, Ruby, etc). No, the database is the foundation of the business. It should be properly designed.

    BUT, it's true, today's SQL databases are pathetic. They don't make this stuff easy. The don't let you create a data type that automatically renumbers the "LINE#" field if entries are deleted or removed. They don't let you create fully updateable views, making it trivial to create alternative key structures on top of your properly designed base tables. They make it hard to refactor and transition schema (views are like methods in OO code.. they let you encapsulate). They make joins expensive. So yes, there's a tradeoff and usually I give up and use surrogate keys most of the time (not ALL of the time though.. depends).

    It's not WRONG to be faithful to the conceptual model 100%. It's a limitation of TODAY'S tools. But the programmers continue to spew their nonsense, the database vendors put out products optimized for programmers... it's a vicious circle.

    Also, I don't know why you're bringing normalization into this discussion. I suspect your knowledge of "ivory-tower " database theory is limited, thus you incorrectly label all ad-hoc design rules as "normalization". (What exactly do you use to when working with databases, if you don't like theory?) Normalization has to do with key dependencies, not the structure of the keys, and is not required by the relational model because it is a *design* concept.

    But since you bring it up, denormalization ALWAYS results in either a loss of data integrity, or a loss of performance. If you denormalize without maintaining integrity (the usual way), then you've fundamentally changed your model (what's allowed in the DB is different now). You better BE DAMN SURE you need it, and you better DOCUMENT IT out the ass. If you denormalize, but add constraints to maintain integrity, then you've killed performance for no reason (however this is useful when transition from denormalized designs back to normalized designs).
  • Science (Score:3, Interesting)

    by Cache22x ( 1056176 ) on Saturday December 08, 2007 @03:02PM (#21625797)
    Okay, all I see on here is negative comments, what ever happened to the concept of "the right tool for the job"? Ruby on Rails is a gem (excuse the pun) in the realm of bioinformatics and chemical informatics. I don't need to be concerned with "scaling" when I am building a site with a maximum of 10 users. For labs and small companies everywhere needing to create and support small or large databases, RoR is fast and easy. It also has major industry backing from the likes of IBM and Apple. It may be a bigger problem for high-volume sites, but I have found it extremely useful. I am using it on the backend (for data management - the data is exported from the database to the legacy perl system daily) for sites like http://www.drugbank.ca/ [drugbank.ca] http://www.hmdb.ca/ [www.hmdb.ca] and on the frontend for sites like http://hmdb.med.ualberta.ca/foodb/ [ualberta.ca].
  • Re:ORM still broken? (Score:5, Interesting)

    by crayz ( 1056 ) on Saturday December 08, 2007 @03:36PM (#21626025) Homepage
    If you do a search for "composite keys rails", hit #1 is this [rubyforge.org], a gem written by a fairly prominent ruby programmer that makes it trivially easy to use composite primary keys within ActiveRecord. My guess is if you actually cared about this issue, rather than just raising it as a canard to bash Rails with, you would have found this solution to your problem and wouldn't be posting here
  • by abigor ( 540274 ) on Saturday December 08, 2007 @03:46PM (#21626101)
    That's why I'm curious as to why Django (Python framework) doesn't get more press. It's fast and, unlike Rails, it's been proven to scale (ie washingtonpost.com). The languages have more similarities than differences, so it can't be that. Better marketing/hype, maybe?
  • At this point...JAF (Score:2, Interesting)

    by sigzero ( 914876 ) on Saturday December 08, 2007 @04:02PM (#21626261)
    RoR is just another framework now. Almost everything has caught up to it. The biggest question to ask yourself is "Do I want to program in Ruby?". If the answer is "no" then meh who cares about this.
  • by slaingod ( 1076625 ) on Saturday December 08, 2007 @04:08PM (#21626305) Homepage
    Every time a RoR article hits Slashdot, there is a scale/speed question that gets raised. Realistically, there are a ton of things you can do to get performance where you want it to be. The first is to dump mongrel and use FastCGI or similar. FastCGI is 3-5x faster than mongrel. Mongrel is great for low traffic sites, and for dev, don't get me wrong.

    The upper limit I see with RoR/FCGI is around 2500 requests per sec, for a 'is the server alive' ping, that simply returns 'Yes'. Typical, results are in the ~100 requests per second range with moderate db access, and rendering to xml or html. 100 requests per second was enough to handle a 24 hour media buy on the frontpage of myspace for example (100,000k unique visitors-ish).

    Moving your static assets off of your server and on to S3 or another CDN is obviously a big help here, so your server/bandwidth is only taken up with requests that need/affect the db. From the example above, with the MySpace media buy, the total for that day was $20-30 I believe in bandwidth costs, and this was a site with a video mixer that had tons of images/video/mp3 and large flash objects. Obviously, mongrel shouldn't be delivering your assets locally anyway, apache/lighty etc should be.

    Ultimately it comes down to design and caching when it comes to getting that top performance out of it. My 100 requests/sec wasn't using MemCached or fragment caching, and the mysql db was local. Caching in Rails is a little less than helpful for highly customized for each user sites, but there are plugins that extend it like extended_fragment_cache(ing?), that allow you to templatize things like ID's, etc. Think of say a forum topic listing, where only the topics change as you paginate. With extended fragment caching, you basically draw the page once, and then pass in a hash of the variables that replace the placeholders each time you draw a new page.

    Another big thing with ajax sites, is to use link_to_remote with the :update => 'some_div', rather than using the rjs/render :update stuff in the controller. escape_javascript is one of the BIG performance issues in Rails, as it is basically just multiple gsubs. Designing around that is a big win. A native C escape_javascript should be a high priority for the rails/ruby devs, with optimization for the memory allocations (ie. scan the string to see how much it will grow, allocate, and just do one pass to expand).

  • by ibbie ( 647332 ) on Saturday December 08, 2007 @04:16PM (#21626375) Journal

    That's why I'm curious as to why Django (Python framework) doesn't get more press. It's fast and, unlike Rails, it's been proven to scale (ie washingtonpost.com). The languages have more similarities than differences, so it can't be that. Better marketing/hype, maybe?


    I think you hit the nail on its head. Django fricken rocks, in my experience, in both speed and usability.

    It just doesn't have the hype engine going for it the way RoR does. It's for this reason that I'm hoping the Perl on Rails thing that the BBC wrote gets some momentum - the MCV/MTV approach is a Good Thing, for web-based development. It's not a change in language, so much as a change in how it's laid out. One must note that CGI::Application (found here [cpan.org]) has existed for Perl for quite some time, and yet very few people (even Perl programmers) know about it, in comparison to RoR.

    I do have to note that, having had experience with both Perl and Python, Ruby isn't bad at all. It's different in some ways, yeah, but so is Java, or C++, or C#. It's more a matter of taste, for a developer.

    And scalability. (:
  • Re:ORM still broken? (Score:3, Interesting)

    by jadavis ( 473492 ) on Saturday December 08, 2007 @04:17PM (#21626377)
    Yup, 5th normal form is a tad much, but there is no reason to don't go 3rd.

    "A tad much"? Either you're being facetious, or you have a profound misunderstanding of normalization.

    In many cases, a relation in 3NF is in 5NF. In fact, you have to be somewhat creative to think of a practical example of something in 3NF but not in 5NF.

    "Normalization" is highly misunderstood. There is no such thing as "extreme normalization". If you see an example of something in 2NF, and then see a 3NF design side by side, you would probably think to yourself "yeah, the 3NF design looks better to me".
  • It is a pity ... (Score:3, Interesting)

    by jopet ( 538074 ) on Saturday December 08, 2007 @04:27PM (#21626475) Journal
    that one cannot simply deploy RoR on Apache. That is what remains the big advantage of perl and especially PHP-based solutions and frameworks.
  • Comment removed (Score:5, Interesting)

    by account_deleted ( 4530225 ) on Saturday December 08, 2007 @04:35PM (#21626549)
    Comment removed based on user account deletion
  • Re:ORM still broken? (Score:3, Interesting)

    by FooBarWidget ( 556006 ) on Saturday December 08, 2007 @04:53PM (#21626669)
    "You're wrong, and you're guessing based on your own apparently very limited experience. Why not just admit that for "simple" CRUD applications ROR is great, for some it still works well, and that for other applications it may not be a good fit... or not work at all."

    I don't know what you've been reading, but that was my point all along!

    And there is nothing wrong with that. Most of the web apps that I make are CRUD-like. I'd still rather choose RoR for its productivity boost over your theoretically-better-and-can-be-used-for-everything-but-totally-pain-in-the-pass-to-work-with $FAVORITE_FRAMEWORK.
  • Re:Why the hate? (Score:2, Interesting)

    by Anonymous Coward on Saturday December 08, 2007 @06:28PM (#21627263)
    It's easy.

    RoR is so over hyped by the zealots that use it and make mythical, false claims. Have you ever noticed how they spit back quotes straight from the site or books or whatnot? If I had mormons and jehovah's knocking on my door daily, I'd be pissed off at them too.

    Why the backlash? False promises lead to adoption and shift job markets. Hype convinces the non technical to make technical choices. Don't any of you remember all the Java hype of yesterday?

    Unfortunately it's not so easy to just ignore and go about your life programming in your language of choice. If you're a perl coder, python coder, php coder, etc and you web develop, then RoR is your enemy. Maybe python should be getting all the attention and hype and the majority of php coders should be moving up not down. Then we'd have better scaling systems anyway. Is python/django so much harder to user than RoR? I'm not convinced that it is. I know for a FACT that it's damn faster.
  • by pavera ( 320634 ) on Saturday December 08, 2007 @09:16PM (#21628133) Homepage Journal
    I prefer django over RoR hands down. I drank the RoR cool aid about 8 months ago, started working on a couple projects... after the initial "oh wow, that was easy to get started" RoR got significantly more difficult, I didn't find the documentation particularly helpful, and things that I thought intuitively would work and made sense were "not allowed" because the RoR conventions forbade them.

    Enter django. Wow, all the power, none of the "Hansson said this is how it should be, so no other way is possible" handcuffs.

    To me django is a much better designed framework, it has in my opinion a much more powerful database abstraction layer, it is more intuitive too. working in Rails for > 4 months I still had to look up the syntax for doing activerecord queries every single time. django's query syntax just makes sense to me, and is much more intuitive. And what can I say, I've never enjoyed making HTML forms more than using the newforms library that builds them for you (oh yeah, and validates them for you, and marshals form input into objects automatically...).

    Also, the simplicity of setting up a production django server is so much easier than RoR. Sure, once you start having lots of traffic, building a fully scalable system is probably going to be similar. But to set up a single server for a low traffic site, or a small company intranet, apache+mod_python is great. mod_ruby has huge performance issues, ror+fastcgi in apache is atrocious, mongrel can be ok.. but then you still have to set up apache in front of it, and its not a simple apache set up as you have to configure all the proxy stuff...

    Besides the fact that python is ~10 times faster than ruby (just at the interpreter level) and you've got yourself a nice little powerful system with django.

    Maybe once django hits version 1.0 they'll get a bit more hype, but I've actually seen more posts on this story saying "check out django" than I've seen people saying they absolutely love rails.
  • by Anonymous Coward on Saturday December 08, 2007 @09:58PM (#21628349)
    That's the point of the Catalyst framework. The only problem most people have with it is that it is perl.

    The only "cool features" is the ability to drop in other stuff you need, and its fantastic dispatcher.

    Oh, and built-in server. And easy test harnesses. And support for fastcgi and mod_perl.

    I guess it does have cool features, but trying to replace PHP isn't one of them.

Love may laugh at locksmiths, but he has a profound respect for money bags. -- Sidney Paternoster, "The Folly of the Wise"

Working...