Slashdot Mirror


Agile Web Development with Ruby on Rails

Ridgelift writes "Learning to develop web applications with Ruby on Rails has gained a huge amount of interest lately, but for people wanting to learn Rails there are no books on the subject. That's changed now with the pre-release of Agile Web Development with Ruby on Rails , the latest book from Dave Thomas and the author of Ruby on Rails David Heinemeier Hansson. It's really 3 books in one: a full Rails tutorial, an in depth guide to the components that make up Rails, and an introduction to developing applications using the Agile development model. There's even a quick introduction to Ruby, the language Rails is built with." Read on for an early review of the beta book. Full disclosure: Reviewer Miles K. Forrest points out that he has read earlier versions of the book's manuscript and provided critiques to the authors. Agile Web Development with Ruby on Rails author Dave Thomas and David Heinemeier Hansson pages 506 publisher The Pragmatic Programmers, LLC rating Excellent reviewer Miles K. Forrest ISBN (Book still in beta) summary A complete primer to developing web applications with Ruby on Rails

At just over 500 pages, Dave Thomas' new book manages to cover a lot of ground in a concise, readable manner. One problem at the outset -- the book is not finished. Knowing that the Ruby on Rails community has been chomping at the bit for morsels of information, Dave and David (DHH) have answered the call by releasing the forthcoming book early. "The book has not had a full technical edit, so it will contain errors. It has not been copy edited, so it will be full of typos. And there's been no effort spent doing layout, so you'll find bad page breaks, over-long lines, incorrect hyphenations, and all the other ugly things that you wouldn't expect to see in a finished book. We can't be held liable if you follow our instructions, expecting to create a Rails application, and you end up with a strange shaped farm implement instead. Despite all this, we think you'll enjoy it!"

And enjoy it I did. The "Getting Started" section of AWDRoR provides a whirlwind overview of the Ruby on Rails' architecture. I found Rails to be very intimidating at first. You can't just cut-and-paste a couple lines of code like you can in PHP. Rails generates all kinds of directories and files, making it feel like your first trip to Disneyland -- you know there's fun to be had, but it's a big place and you don't know your way around. The reason for all this is because, in programming, short simple scripts are easy and simple, full blown Web applications are not. Many LAMP projects developing in perl/Python/PHP and any number of templating engines have started simple, but grown into unruly messes that are difficult to maintain. While trying to grok Ruby on Rails, topics like Model-View-Control and Object-Relational Mapping really don't stick at first. Add to the confusion that many of us are also struggling to learn Ruby and a RDBMS (such as MySQL; Rails works with others databases as well). The overview of Rails is necessary, but I found it to be a lot more helpful rereading it after completing the tutorial section. So if you read through this first section and feel lost like I was, just know that the material will become familiar to you and press on, because it gets a whole lot easier from here on in.

I really enjoyed the Tutorial section, a narrative designing a shopping cart application for a customer. Dave says it best: "Does the world need another shopping cart application? Nope, but that hasn't stopped hundreds of developers from writing one. Why should we be different? More seriously, it turns out that our shopping cart will illustrate many of the features of Rails development. We'll see how to create simple maintenance pages, link database tables, handle sessions, and create forms. Over the next seven chapters, we'll also touch on peripheral topics such as unit testing, security, and making our pages look nice."

Dave begins not with lofty design plans, but with a tool most real programmers use: napkin drawings. Many of us sit down over coffee with a customer and talk about what they need, sketching out ideas with paper and pencil, not some complex software planning tool. Each chapter in the tutorial section allows a story to unfold, where the customer works alongside the developer. Real life situations like changing direction or refactoring code are covered as each programming session is done. You really see why Rails is becoming so popular. It wasn't written by a team of programmers trying to hammer out an arbitrary list of features, but rather Rails was built around a real application (Basecamp). Pragmatic considerations such as developer time, feature creep, and maintenance issues have all been skillfully addressed in Rails. The tutorial reflects this, and at the same time it also gently, almost unknowingly, teaches principles as outlined in the agile manifesto. Some of the goals include:

  • Individuals and interactions over processes and tools
  • Working software over comprehensive documentation
  • Customer collaboration over contract negotiation
  • Responding to change over following a plan
AWDRoR can get away with this because Rails itself was designed around the principles of Agile software development. The tutorial is probably the best I've ever read. You really come away from it knowing not only what you've written, but why, as well as picking up a few expert developer tips along the way.

The third section, "Rails in Depth," dives into the inner workings of Rails. Components such as ActiveRecord, ActionController, ActiveView, and Web Services (Ajax) are all covered well. There are even chapters on securing and deploying your applications properly. These chapters, in conjunction with the API docs found on www.rubyonrails.org, give a full overview of Rails. Most helpful in this section are the notes and diagrams which help pull everything together. The appendices that cap off the book also provide the full tutorial source code, as well as a brief introduction to Ruby, the language that makes all the magic happen.

In short, Rails is a brilliant architecture, and Agile Web Development with Ruby on Rails is a great book. I'm reluctant to point out its shortcomings as it's still in beta, but it's really hard for me to find much to complain about. It took me some time for the light to come on with Rails, but once it does, you see that Rails could not exist without Ruby, the language it's inextricably woven into. As Dave Thomas is quoted on www.rubyonrails.com, Rails is probably "the framework to break Ruby into the mainstream." Whether you believe the hype or not of "super productivity," "Ten times faster development," and "Better than anything else," Ruby on Rails is a great tool to add to your belt. In fact, I find myself using it exclusively for Web apps, and I catch myself using python and PHP less and less and Ruby more and more for my day to day programs.

If you want to learn Ruby on Rails, Agile Web Development with Ruby on Rails is a great choice, and will probably be the definitive book on the subject.

Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

31 of 222 comments (clear)

  1. Re:wasn't this just on here? by falzer · · Score: 2, Funny

    Nubile virgins.

  2. Ruby is quite cromulent. by HillaryWBush · · Score: 4, Funny

    I particularly enjoy their persistable domain model (where logic and data are bound in one wrapping). The one-method-per-action-controller-request-router is sweet. And there's nothing like sending out forgotten passwords and invoices from easy-to-test email service layers on top of sendmail. To dust off an old chestnut, I welcome our new buzzword-crazed overlords. It's too bad that I already have a good job as a clown.

  3. Suggestions by ajakk · · Score: 2

    I am putting together a CMS type web application, and I would like some recommendations on infrastructure to use. I have tried modifying existing PHP apps, and I have only had moderate success with that. I have experience in Python, PHP, Java, and am willing to try almost anything (Perl is almost). From looking at the Apache Java solutions, those look a little to heavy. I have looked at Zope, but I have never gotten comfortable with its administration or syntax. I have thought about using Cheetah and WebWare/Webkit. All of this hype about Ruby on Rails had made me want to take a look at it. I know this is sorta open ended, but does anyone have any good suggestions?

    1. Re:Suggestions by abigor · · Score: 2, Informative

      CherryPy is quite nice (Python-based web app framework). Very quick to get stuff up and running.

    2. Re:Suggestions by Marillion · · Score: 2
      Since this is a Rails Article, I have found Typo which is a Rails based Blog tool that's along the same lines as WordPress or MoveableType and others. It has Comments, RSS+Atom feeds.

      You can use all the MoveableType posting tools to maintain content - or use the builtin Active Record, HTML based Admin Tool.

      It's pretty young, and has a few bugs in the XML-RPC interface. But, it was easy to customize and fix the XML-RPC bug.

      If you promise to be nice to my home DSL line: The Fermata

      --
      This is a boring sig
  4. Re:Charge for Beta PDF and booK? by braeburn · · Score: 3, Informative

    They sell their book as either a PDF or a physical book, the PDF being cheaper. You can buy the beta PDF and when the book is released you'll get the final PDF. Or, a little more money, you can buy the PDF and get the physical book when it comes out.

    Considering the normal cost of technical books, I think it's a sweet deal. These are not small books.

  5. Re:Charge for Beta PDF and booK? by Peter+Cooper · · Score: 4, Informative

    Incorrect. If you buy the book now, you'll get the beta PDF and the book when it comes out. Likewise, if you just buy the PDF, you'll get the full PDF when it's all done. You are not just buying a beta in either case.

  6. Re:Since when does "huge" apply to Ruby? by Peter+Cooper · · Score: 3, Informative

    Since 1000 people bought the book within the first week or two, I guess not. We have more than 200 people in #rubyonrails on irc.freenode.net alone, and this makes up a fraction of the community.

  7. $22.50 for the Beta .pdf, $43.75 for the real book by Harry+Balls · · Score: 3, Insightful

    It doesn't look like you get a discount on the physical book when you purchase the Beta .pdf

  8. Re:why is slashdot obsessed with RoR? by Peter+Cooper · · Score: 3, Insightful

    That's incorrect. Even if we assume your statement is true, RoR offers "little more" in the same way that C++ offers "little more" over C.

    Rails is a flexible framework that allows you to keep your house in order when coding Web applications and which encourages test driven development. Ruby, as a language, makes this all very easy as almost everything in Ruby is an object, so the syntax becomes intuitive. Some people tried to replicate RoR with PHP, and the syntax was vile and full of syntactic salt.

    Using Rails to develop Web apps, as opposed to, say, PHP, is like using a language that has garbage collection over one that does not. It removes another level of complexity and lets you focus on the important stuff.

  9. Your math sucks. by nacs · · Score: 2, Informative

    It's $22.50 for the PDF by itself or $43.75 for the dead tree book and the PDF.

    In other words, the printed book is $21.25 if you take out the cost of the PDF.

    I purchased the combo the day after it was released and must say it's more than worth the price.

    --
    "I filter at +6, and have yet to miss out on an important comment." (#822545)
  10. Re:Hard to believe by Peter+Cooper · · Score: 2, Insightful

    The problem is that most incoming developers are coming from TMTOWTDI languages or are not initimitely familiar with OOP. Ruby's flexibility allows you to code in a somewhat C/Perl-esque "by the seat of your pants" fashion if you want, but it heavily encourages doing things in a very object-oriented test-driven way. Books and tutorials are necessary to beat this into the heads of incoming developers. An MVC framework is not a new idea and Rails is by no means the first, but it's the first to be picking up such novice coders. Tutorials are essential. When I started Rails eight months ago, there was no third party documentation or tutorials.. and I'm still correcting my bad habits even now.

    And, well, basic documentation is necessary everywhere. People know they shouldn't kill each other or commit adultery, yet billions around the world still keep a Bible/Koran/Torah handy.

  11. hmmm by einer · · Score: 4, Interesting

    In short, Rails is a brilliant architecture, and Agile Web Development with Ruby on Rails is a great book.

    I believe that not grokking MVC detracts from the value of your review, particularly with respect to your opinion of the architecture of Rails. Without understanding MVC, you can have no understanding of the design decisions they made, and as such, no qualified understanding of the architecture itself.

    This was my only concern. Thanks for the review!

    1. Re:hmmm by Ridgelift · · Score: 2, Interesting
      I believe that not grokking MVC detracts from the value of your review, particularly with respect to your opinion of the architecture of Rails. Without understanding MVC, you can have no understanding of the design decisions they made, and as such, no qualified understanding of the architecture itself.
      Yep, I admit fully I'm probably not qualified as others to review the book. But I can only give my opinion, and for a newbie who's played with other architectures and run into a big pile of messy code after awhile, I can say I haven't experienced this with Rails. So while I might not understand exactly why Rails helps keep things neat and tidy, I can say what I personally have experienced. Or another way, I can't tell you why Mozart was a musical genius, all I know is I recognize that he is based on what I've heard.

      If it helps, let me change my statement: In short, Rails is a really, really good architecture 'cause it helps me keep develop code faster and cleaner than anything else I've used, and Agile Web Development with Ruby on Rails is a great book because even newbies can understand it.

      So since I readily admit my opinion isn't a qualified one, how about something from O'Reilly instead:
      Ruby on Rails is astounding. Using it is like watching a kung-fu movie, where a dozen bad-ass frameworks prepare to beat up the little newcomer only to be handed their asses in a variety of imaginative ways. I've got David Heinemeier Hanson giving a session, tutorial, and keynote. That's how much I love "convention over configuration" and the other philosophies behind Rails. Rails shows us a very interesting future for web applications, and is a great example of innovation from within the open source community.
    2. Re:hmmm by JamesOfTheDesert · · Score: 2
      So since I readily admit my opinion isn't a qualified one, how about something from O'Reilly instead:

      I hate to be cynical, but O'Reilly are planning their own Rails books this summer. Not that they would hype something they didn't believe in ...

      --

      Java is the blue pill
      Choose the red pill
  12. Wow by aftk2 · · Score: 4, Insightful

    Could this review be more fawning, please?

    The appendices that cap off the book also provide the full tutorial source code, as well as a brief introduction to Ruby, the language that makes all the magic happen.
    In short, Rails is a brilliant architecture
    Agile Web Development with Ruby on Rails is a great choice, and will probably be the definitive book on the subject. The tutorial is probably the best I've ever read.

    God. That last one sounds like Napoleon Dynamite.

    A "beta" book, in PDF form, with typographical and technical errors, will probably be the "definitive book" about a brand-new framework? What a statement...

    Don't get me wrong - I haven't had much time to play with Rails, and as a web developer, I probably should, in order to keep my skills fresh. I may even like it. But this fervent, sycophantic praise - spurred on by the blogerati (flamesuit enabled) - seems premature, especially when there are many capable web application frameworks out there. In the future, it might even seem silly. After all, anyone want to admit to owning a copy of Oreilly's book about Slash?

    --
    concrete5: a cms made for marketing, but strong enough for geeks.
    1. Re:Wow by nacs · · Score: 2, Informative

      The tutorial really is one of the best I've ever read, spans 131 pages and walks through building a high quality app with an administration interface and unit testing thrown in.

      Many /.ers are seeing the 'beta' line and automatically equating it with 'crap'. The actual book, however, is excellent even in it's beta stages and is easily better than many of the non-beta technical books I own.

      This book is written primarily by Dave Thomas who wrote pretty much the definitive book on Ruby and who was kind enough to contribute the first edition of the book to the Ruby community (you can read it online here).

      --
      "I filter at +6, and have yet to miss out on an important comment." (#822545)
  13. Better than Java, or just easier? by jtogel · · Score: 2, Interesting

    As I understand it, Ruby/Rails has got a lot of attention lately as it seems to be an easy to learn yet powerful way of creating web applications, for people that normally use php. However, while php is great for quick hacks, it really caters most to those who have never had any proper programming education, and is not very well suited to anything more advanced than a shopping cart. (No, this is not flamebait, it's fact. Sorry for offending some of you, I don't know how to put it otherwise.)

    So, my question is: is there anything in all that RoR buzz for those who actually have CS degrees and usually do web development with JSP/servlets? Is RoR in any way better than Java, or just easier?

    1. Re:Better than Java, or just easier? by Peter+Cooper · · Score: 2, Informative

      The business analysis: If you're working on high-end enterprise apps, or apps that demand a very long term investment, I'd say stick with JSP. Rails isn't there yet. If you're working on Web apps with a small(ish) development team and are mostly concerned with getting something out there that's secure, quick, and full featured quickly then Rails is, really, the only way to go.

      The coding analysis: Ruby has a lot of semantic advantages over Java. It's easier to read, has less syntactic salt, and encourages test-driven development a lot more. It's also easier to migrate to from other languages, and most RoR coders are very recent migrants from either Java, PHP or Perl. RoR is easier than Java, and in many cases this would mean "better", but... "better" is highly subjective. I'd still say Java is preferable at enterprise level, but Rails more than has its place, and kicks Java's butt when it comes to rapid, reliable development with a small team.. but Java.. it's all about the enterprise.

  14. Dave Thomas is writing from the grave?!?! by wernst · · Score: 2, Funny
    Dave Thomas wrote this book?

    Talk about an active guy! He helps Colonel Sanders start a chicken business, then founds his own restaurant chain, then dies, THEN writes a book about Ruby on Rails?

    I'm clearly not doing enough with my life...

  15. Re:Hard to believe by Peter+Cooper · · Score: 2, Interesting

    You'd be surprised. A lot of supposedly OOP code is written in a horribly procedural fashion even nowadays. I'd guess this is because the most popular OOP languages encourage it, by mixing procedural languages with OOP.. such as VB or Delphi.

  16. And for the Perl folks out there... by AGTiny · · Score: 2, Interesting

    If you're interested in cool web frameworks, but don't want to learn Ruby, you might be interested to know there is a similar framework available for Perl called Catalyst. It's very flexible but generally takes advantage of great database mappers like Class::DBI and template engines like Template Toolkit. Many cool things are ongoing in the Catalyst community, such as Class::DBI::Sweet, a new extension to Class::DBI providing very cool automatic joins (ala ActiveRecord) and object/resultset caching.

    Catalyst can be found at catalyst.perl.org or on CPAN.

  17. Rails posts prediction ... by Chromodromic · · Score: 4, Insightful

    I predict there will be basically two categories of posts about Rails.

    Either, one, that Rails is so amazing that after you use it sex seems laughably trivial by comparison, even and especially you count the production value -- one can, after all, only have one child (on average) using sex, but with Rails, dude, I HAD TEN.

    Or, two, that Rails is no big deal, it's just another MVC re-think, heck I rolled one of those myself one afternoon a coupla years back, yeah it ruled but, you know, I'm really into that Java thing now. Besides, Rails is no good for BIG projects, for that you need Hibernate and a crane.

    So I'll post one for the middle-of-the-road. Rails rules. I love it. I've reimplemented, in a week-and-a-half, a fairly large application that took me two months to do with Python. It's not a fair comparison because with Python I used Webware but did everything, like user management and logging, with no starting point, and also the first time around I wasn't as familiar with the problem domain.

    With Rails I used the Salted Hash Login Generator which got the basics of my user login and management done in one fell swoop, an hour or two of work. I also re-used the view code from the Python app.

    But the rest of it was fun. I enjoyed it. Things were done quickly and the API is awesome. ActiveRecord is not Hibernate -- yes, Javapeople, we know, we know -- but it's good. It's really good and super easy. And while there's some magic going on behind the scenes with Rails, it's not hard to understand at all.

    That said, yes, if you're an online payroll system for IBM, Rails won't cut it. There are flaws, but for day-to-day stuff, not too many. It's updated very frequently, too.

    My only complaint is the ubermensch of Rails, Dave Heinemeier, who, while smart, is also all too aware of it, and frequently shoots his blog off about topics which go beyond Web frameworks and into areas of either glib tech-prejudice or, at times, more subtle see-how-smart-I-am dorkposts -- the most insufferable species of Geek.

    Otherwise, I strongly encourage anyone to check Rails out. It's great and a *lot* of other frameworks in other languages could stand to pay attention to the innovations in Rails. These innovations aren't so much technical epiphanies, as they are the meeting of many good ideas in one place, along with enthusiastic support and a lot of glue. Ruby's fun, too.

    Check out, also, the frameworks from other languages which are shamelessly stealing from Rails:

    Subway (Python)
    Catalyst (Perl)

    --
    Chr0m0Dr0m!C
  18. Slashdot these days: by Qbertino · · Score: 3, Funny

    RUBY! AJAX! ORGASM! Hit it with a RAIL!
    R!
    O!
    R!
    ROOOOOAAAAR!
    RUBY ON RAILS! So fucking awsome I gotta, ... I, OMFG!!!111!! I'm coming, I'm gonna, OMG ... say "I like your monkey!!!" SAY IT! - .... OOOOooooohhhh, Rubyajaxrails, yeaaaah!!
    I've got it! Yeah! I've got a vision, people, a vision!
    We're gonna have Ajax and we're gonna put it on Rails and it's all gonna be like Lucy in the Sky with Rubys.
    Oh my gosh am I seeing some shit....
    This is so awesome... ...and any Beta mindfart about it is like ten times ten Ajax orgasms!
    (And now for the real thing watch this post being modded +10 Insightfull)

    --
    We suffer more in our imagination than in reality. - Seneca
    1. Re:Slashdot these days: by Ridgelift · · Score: 2, Insightful
      This is so awesome... ...and any Beta mindfart about it is like ten times ten Ajax orgasms!
      (And now for the real thing watch this post being modded +10 Insightfull)
      I love how on Slashdot if you show any enthusiasm you're a mindless lemming, and if you're overly critical about anything (sans Microsoft) you're a biased ignoramus.
    2. Re:Slashdot these days: by Qbertino · · Score: 2, Funny

      Now you did it. After you said that my Ajax has gone all agile.

      --
      We suffer more in our imagination than in reality. - Seneca
    3. Re:Slashdot these days: by typhoonius · · Score: 3, Funny

      Random facts about Ruby On Rails:

      Ruby On Rails came up with 97% of the famous quotes from Napoleon Dynamite."

      The constellation 'Ruby On Rails' is made up by connecting every single star of the night sky.

      For a brief period in history, Ruby On Rails had stolen the letter F from the alphabet, that is why we have words such as Photo and Dr. Phil.

      Ruby On Rails' leg hair is harvested bi-monthly for use in fine Scandinavian carpets due to it's extreme strength, durability, and ability to ward off Russians.

      Pick any two consecutive digits of the number pi. Added up, they will always equal Ruby On Rails' age.

      On the third day God actually said, "Let there be France!" So Ruby On Rails killed him, became God, and uttered the now famous, "Let there be Light!"

      If one attempts to calculate the awesomeness factor of Ruby On Rails, cubed by the awesomeness of a badger divided by the awesomeness of ninja-pirates, one has the basis for the weapon that destroys the universe.

      Ruby On Rails: Rockin the bitches since 1863.

      When Ruby On Rails told the Microsoft Word paper clip to go away, it never came back.

      Ruby On Rails possesses Excalibur.

      In the criminal justice system, the people are represented by two separate yet equally important groups: Ruby On Rails, who investigates crime; and Ruby On Rails, who prosecutes the offenders.

      Ruby On Rails owns 90% of patents in the USPTO under false names.

      Both Lee Harvey Oswald and Ruby On Rails killed JFK. Oswald fired Ruby On Rails out of his rifle. Ruby On Rails penetrated JFK's head then exploded.

      For God so loved the world, that he gave his only son, and his son's favorite web development framework, Ruby On Rails. Whoeverso believes in his son, and programs web applications with Ruby On Rails, shall not perish, but have eternal life. Whoever forgoes Ruby On Rails will burn for all eternity. -John 3:16 (more or less)

      (with apologies...)

  19. Ruby vs Java by nostriluu · · Score: 3, Insightful

    Ruby sounds really interesting, but after all the language is just one aspect of development.

    I use Java (and parts of J2EE).
    Its too bad there's no truly free/open source runtime yet, but I'm sure that day will come soon.

    Another problem with Java is really too much choice. Sun's higher level solutions tend to be over engineered, so everyone and their uncle have designed their own complex framework for object persistance and session management, along with the mixed bag of JSRs. Thus you have Java advocates like Javalobby saying Ruby on Rails is a great framework, and all the best free CMSs are PHP.

    I am sure that Ruby on Rails makes it quick to put up a web site that supports database CRUD operations, but just like using Visual Basic to create forms, what do you have after that part is done?

    The reason I like Java is its maturity and community, as well as the rigidity of the language.

    Because of its multi vendor and open software support, you can find an open source or at worst free-as-in-beer library to do just about anything, and there's plenty of discussion about using all the components that exist.

    If you don't like Java's rigidity and verbosity, there are some nice improvements in JDK 1.5.

    From pre-1.5:

    void cancelAll(Collection c) {
    for (Iterator i = c.iterator(); i.hasNext(); ) {
    TimerTask tt = (TimerTask) i.next();
    tt.cancel();
    }
    }

    in 1.5:

    void cancelAll(Collection c) {
    for (TimerTask task : c)
    task.cancel();
    }

    Or you can execute Groovy, Jython, JRuby, etc in a JVM, or alongside PHP with JSR 223.

    I don't think execution speed arguments against Java are accurate any more, especially when comparing it to languages such as Ruby, Python and PHP, and I find the memory requirements to be easily manageable in typical situations (Firefox, alas, takes much more memory on my workstation).

    Creating a working application in any environment is fairly easy for anyone with sufficient training and experience, but unless you're a rare master, once you are at that plateau of a working app and you need to change it, the maturity and popularity of your environment become very important for support.

    I think hands down Java is the winner here with great tools like Eclipse, with great refactoring support and where you know even in large projects what is broken as you're working on code, as well as the large community for support.

    The portability of Java is also very good, you can become very OS agnostic (unless you need to get into a few aspects such as multimedia).

    Anyway, sorry to wax on, and I'm always trying to find out what other environments offer, but I don't think Java is given enough credit.

  20. Zope by Qbertino · · Score: 2, Insightful

    What Ruby on Rails wants to be when it grows up.

    --
    We suffer more in our imagination than in reality. - Seneca
  21. Don't let your Java get run out on a Rail just yet by bADlOGIN · · Score: 3, Insightful

    I've had to look at Ruby On Rails due to decisions made by some of my agile team members. There's a number of important things to be aware of if you or someone on your team is seriously thinking about using RoR to replace Java web apps. Be forewarned, while these are my own extremely biased opinions, they are in no way uninformed:

    1.) Give up a decent IDE. The development tools are crap. Good luck trying to fire up a Ruby IDE, and set a breakpoint in WEBrick or Apache mod_ruby. You can't. Even if you hack around with the breakpoint command and include the debugger in the code you want to debug, the debugger is buggy and makes old skool commandline tools look sharp.

    2.) Bet the farm that RoR only deals with you 80% problem, and your requirements won't break how it needs the ActiveRecord pattern. ActiveRecord looses it's luster once things get complex (see http://www.theserverside.com/articles/article.tss? l=RailsHibernate).

    3.) How do you like your OO style? If it's from the Jacobson camp, you're in for a treat! Objects are just dumb repeats of database tables 1st and foremost. Oh sure, you can add methods to do that OO thing if you must, but that's not the true essance. If you believe true object nature comes from behavior and not data, (ala Yordon & Coad) you won't be comfortable here.

    4.) You're agile? You "get" test driven development? Give it up. RoR says you use a script. This hurts even more if you take issue with number 3 above. RoR rewards you for being database driven. Just define your scheme and all of your objects and a few controllers will get generated for you along with stub unit tests that pass by default. Just accept the required two line *Helper classes as well(yeah. TDD would have pushed me to create those).

    5.) More on testing: hope you like having to rely on populating test data into your database. We kept hearing you can mock your persistance, but even some of the experts we talked to couldn't show us how (folks who are paid to work on a RoR product). Sure, folks said dependancy injection via Needle, but we couldn't find jack out about it.

    6.)Speaking of database driven, that is a greenfield project you have with no legacy concerns and absolutely no complex O/R mapping requirements, you're starting RoR on right? No?!?! That's ok. just shoehorn RoR with updateable views or change your schema so that ID's are done the way ActiveRecords likes. That's no problem for your existing aps, is it?

    7.)That had better be an OpenSource database you're using. It's not unheard of to "enjoy" a broken release for packages like ActiveRecord when the developers don't have access to Oracle or SQL Server. This happened to us and RoR was broken for about a week between releases in the 0.9 to 0.10 range. Yeah. That was a "release". Not CVS, not alpha or beta. Release. On the upside, we did patch ourselves, so "go OpenSource".

    If the Rails fanboys want to mod me down, have at it. I stand by my overall opinion. Keep in mind, I have no issue with Ruby itself. In fact, it stands to give Java a real run for it's money. RoR on the other hand, is immature and over-hyped at best, and a rat's nest of garbage at worst.

    --
    *** Sigs are a stupid waste of bandwidth.
  22. Re:Defending Python by darnok · · Score: 2, Insightful

    > Ruby doesn't really bring any significant
    > advantages over python. Neither does
    > Ruby-on-rails. It's just the new-kid-on-the-block
    > enthusiasm that Ruby is enjoying ATM.

    As someone who coded in Ruby, Perl and Python today(!), I'm inclined to agree to some extent.

    Where both Ruby and Python are failing to replace Perl is with something comparable to CPAN.

    For example, this morning I was trying to parse a bunch of data out of HTML tables in Ruby, and tearing my hair out with frustration; I switched to Perl, grabbed HTML::ParseTable from CPAN and had a working solution within 10 minutes. It worked exactly as I'd hoped, and I didn't have to know anything particularly clever to use it.

    Looking at the code for HTML::ParseTable, it's not especially complex; a few hundred lines of reasonably clear Perl, plus some very good documentation and examples. However, the effort that's gone into it to get it to its current state - as I saw today, it's able to accurately parse HTML that was apparently handcrafted by a moron with a grudge - is its real value. Presumably it's been beaten into shape by many people over an extended period, and it's largely bug free at this point.

    Given the inclination, I could build a HTML::ParseTable equivalent in either Ruby or Python, but why would I bother? The Perl one works now, and it's very rare to find an employer that will use Python and/or Ruby but not Perl.

    If/when Parrot allows Ruby and Python to leverage CPAN, that's the point where I think Perl will finally be replaced as the most popular scripting language. Until then, as much as I dislike supporting Perl code, forget it.