Slashdot Mirror


Ruby For Rails

Simon P. Chappell writes "This may not be the book that you think it is, if you don't read the title carefully, but it is the book you need, if you are developing applications for Ruby On Rails (often known as just Rails, or RoR, to its friends). When learning any new development platform, there are many idioms and approaches, best practices if you will, that can benefit your development efforts. This book sets out to bring you that understanding of the best way to write the Ruby side of your Rails application." Read the rest of Simon's review. Ruby For Rails author David A. Black pages 493 (17 page index) publisher Manning rating 10/10 reviewer Simon P. Chappell ISBN 1932394699 summary A stunningly well written explanation of real-world Ruby skills for Rails development.

I see two main audiences for this book. The first group would be those who are learning to develop Rails applications and need some help with their Ruby skills. The second group would be those who already have good Ruby chops, but who want to learn the primary Rails idioms and techniques. Naturally, there is always the curious geek crowd who might find the twofer of an introduction to writing real-world Ruby and a hype-free description of what Rails actually brings to web development, to be quite attractive. I place myself firmly in the third group, but after reading this book, I'm ready to move to the first group.

To quote it's own website, "Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern." The first thing this tells us is that like any framework worth it's salt, it is fully buzzword compliant. The second thing it tells us is that it really does try to help with every layer of your application, from providing a full controller to automatically mapping your data objects to their respective backend database tables. Oh, and with the bare minimum of configuration files to boot! For those of us who have developed web applications with Java, this is a welcome break.

The first part describes "The Ruby/Rails Landscape" and has three chapters that describe how Ruby works, how Rails works and then shows a very simple example of Ruby-enhanced Rails development.

The second part describes "Ruby Building Blocks" spanning five chapters, four through eight. This part is a very good tutorial style introduction to Ruby. Chapter four introduces objects and variables with chapter five showing how to organize those objects with the concept of classes. Chapter six introduces us to modules and program organization in general. Chapter seven talks about the default object, self, and scope. Chapter eight covers control flow techniques. This is more than just a fancy way of saying conditionals and loops, because it includes one of the better explanations of closures that I've read to date.

The third part describes "Built-in Classes and Modules", in chapters nine through thirteen. Chapter nine covers some of the Ruby language essentials for Ruby development in the trenches. These include useful syntactic sugar, the family of methods that change data "in place" rather than returning a modified copy, some of the tricky aspects of the Boolean objects and the proper ways to compare two objects so that you get a comparison on their contents, which is likely to be what you want, rather than their memory location. Chapter ten looks at scalar objects: strings, symbols, numbers, times and dates. Chapter eleven examines the Ruby collections: arrays and hashes and discusses when you would use each one, based on their relative strengths. Chapter twelve looks at the regular-expression facilities within Ruby and chapter thirteen wraps up our tour of Ruby with some of the dynamic aspects of the language, including the "eval" family of methods that allow a Ruby program to run arbitrary code.

The fourth and final part describes "Rails Through Ruby and Ruby Through Rails". To quote the book, the purpose of the fourth part is "helping you get more out of Rails by knowing more about Ruby." To this end the simple application created in the first part of the book is revisited and revised. Chapter fourteen starts us out with remodeling the application written back in chapter three. Chapter fifteen looks at programmatically enhancing ActiveRecord models. Chapter sixteen covers the options available for enhancing the controllers and views. Finally, the part wraps up with chapter seventeen where techniques (and much encouragement) for exploring the Rails source code are shared.

The writing is excellent and the style is very engaging. Every concept is stunning well explained. Much as I liked and enjoyed "Programming Ruby" (the "pickaxe book" to it's friends) by Thomas, Fowler and Hunt, this book takes the state of Ruby writing to a new level.

The progression of the book is very well thought out. The first part introduces us to both Ruby and Rails. You can create basic Rails applications with very little Ruby and that's exactly what this first part walks you through. Then parts two and three teach Ruby skills and idioms that are directly applicable to Rail application creation. Part four takes these new skills and shows them being applied to the second Rails application of the book. I found this to be a very good sequence for progressing through the material.

The examples in the book are excellent and many of them are geared towards Rails-style situations. This not only helps to teach Ruby skills, but also keeps the Rails context firmly front and center during the process.

The index on this book is a magnificent 17 pages. That's not something you see too often.. The art of a good index seems to be somewhat lacking these days, but this book helps to redress the balance.

If Ruby on Rails is of no interest, then this book is most likely not the one you want. Also, if you were looking for something with an exhaustive, reference-style, coverage of Ruby, perhaps you'd be better off considering something like the "Programming Ruby" book.

This is a great book, that's very easy and enjoyable to read. It's a stunningly well written explanation of real-world Ruby skills for Rails development."

You can purchase Ruby For Rails from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page

173 comments

  1. I'm also a type 3 by andrewman327 · · Score: 4, Interesting

    I have trouble learning about things when I do not understand how they work. What I like about this book is that it goes out of its way to explain how the technology works. So many programming books start with: "Now write the following code snippit in the IDE and compile." For the first time reading a /. book review, I actually want to buy this book!

    --
    Information wants a fueled airplane waiting at the hangar and no one gets hurt.
    1. Re:I'm also a type 3 by jargoone · · Score: 3, Informative

      And, like usual, buy.com has it even cheaper than Amazon.

    2. Re:I'm also a type 3 by Anonymous Coward · · Score: 0

      No, Amazon's affiliated sellers offer it several dollars cheaper than in your link.

    3. Re:I'm also a type 3 by Anonymous Coward · · Score: 2, Informative

      And as usual, bookpool.com has it even cheaper than that.

  2. Right time by fak3r · · Score: 1

    It's about the right time for a RoR book, since things have been moving so much of late, but after 1.0 (1.1) rails things should be 'solid' enough to learn from. I used a few RoR apps for a time, but their instablitiy (which may had been caused my my inexperience) was unforgiveable. Perhaps this book would be a good read.

    1. Re:Right time by tcopeland · · Score: 3, Interesting

      > It's about the right time for a RoR book, since
      > things have been moving so much of late,

      Yup, and this book will last for a while since it focuses on how Rails uses Ruby to do the metaprogramming "magic". So if the APIs move on slightly the techniques in Dr. Black's book still apply.

      For those who aren't on the Ruby lists, Dr. Black is a long-time Ruby user, a founder of the 501(c)(3) Ruby Central that organizes the Ruby conferences, and generally a Rubyist from way back. He's rather a guru but he still answers questions on the mailing lists and generally does a lot of grunt work.

    2. Re:Right time by Anonymous Coward · · Score: 0

      There already was a good RoR book, titled "Agile Web Development With Rails". I found it very useful, coupled with the API documentation.

  3. Re:Oh vey. by rainman_bc · · Score: 0, Troll

    I can't wait for the day ruby on rails loses it's buz and the infinite amount of Ruby on Rails has been derailed jokes.

    I can't wait for the day all dumbasses learn the difference between its and it's

    --
    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
  4. Fad by Umbral+Blot · · Score: 2, Interesting

    I would invest time and money in Ruby on Rails, except that it is obviously a passing fad. This is because Rails is designed to solve a specific problem (serving web pages), and we know for sure that the serving web pages won't be a problem for all time. What people want the web to do, and how we share information over the internet, is bound to change, and when it does the Rails way of doing things will be about as useful as the Java Applet way of doing things (which was for a time The Big Thing, but now is used only in special situations). Ruby as a whole however is definitely worth learning, since it is an adaptable language, although I fear its association with Rails may kill it when Rails dies.

    1. Re:Fad by mini+me · · Score: 1

      You're right about ActionPack. The other parts of Rails are extremely useful in just about every domain.

    2. Re:Fad by mclaincausey · · Score: 5, Interesting

      There's no reason to assume that Rails will fail in the near term. Rails is based on a method of decomposing software functionality that does back to the 1970s (Model-View-Controller). Rails might not be here forever, but it has a very solid architectural foundation and it is easy to adapt it to the latest trends (for instance, you can create AJAX-based Web applications very easily with RoR). In other words, the extensibility and architecure of Rails make it adaptable, just as you mention Ruby being adaptable.

      --
      (%i1) factor(777353);
      (%o1) 777353
    3. Re:Fad by misleb · · Score: 4, Insightful
      I would invest time and money in Ruby on Rails, except that it is obviously a passing fad. This is because Rails is designed to solve a specific problem (serving web pages),


      Doesn't this apply equally well to every other web framework out there? Browsers are designed to solve the specific problem of reading web pages? Are they just a fad too?

      -matthew
      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    4. Re:Fad by JoeyLemur · · Score: 2, Interesting

      You're basically saying the web is a passing fad, then.

      And your arguement of Rails killing Ruby when it stops being the flavour-of-the-week doesn't hold much water... Perl was associated quite closely with CGI programming back in the day, and its grown beyond it.

    5. Re:Fad by knewter · · Score: 1

      A few things. First, ignoring entirely whether or not Rails is a passing fad, the fact is that it solves a current problem (writing web apps quickly and robustly) extremely well. I quit my job programming .Net to start my startup because I wanted to be productive, and Rails made me far more productive. Secondly, speaking to the 'Ruby will be taken down with it' comment: seriously I can't imagine how this could happen. Ruby's been around for ten years, and its enthusiast community won't leave it because some usurpers' failed framework went down. (Note, I don't think Railsers are either usurpers or doomed to failure - I feel certain this is simply an ignorant poster.) The new Rails Ruby users might jump ship, but that won't change the trend that had been set before Rails now will it?

      --
      -knewter
    6. Re:Fad by Umbral+Blot · · Score: 2, Interesting

      Your very wording however reveals the difference that I am driving at. Consider "the extensibility and architecure of Rails make it adaptable". This implies that one has to work to adapt Rails to new situations. You would not say the same thing about a programming language. A programming language simply is adaptable, one doesn't have to work to adapt it to new kinds of algorithems. The distinction I am making here is that you can learn something X (say Ruby) which you can apply to many tasks, or you can learn something Y (say Rails) which is suited for a particular task. Even if you can adapt Rails to do something else, that is more like learning Z (Rails 2.0) which is suited for something else. The key is one doesn't want to have to constantly chase around the latest trends, that is a good way to get burnt out.

    7. Re:Fad by Umbral+Blot · · Score: 1

      No, but I am saying that our current expectations of the web (I'm looking at you AJAX) are a passing fad. Next year there will be some other hot new web technology that will make Rails and AJAX obsolete. It might even make web pages obsolete, who knows. The point is that it is better to keep your options open since the future is unknowable.

    8. Re:Fad by Umbral+Blot · · Score: 0, Redundant

      No, but I am saying that our current expectations of the web (I'm looking at you AJAX) are a passing fad. Next year there will be some other hot new web technology that will make Rails and AJAX obsolete. It might even make web pages obsolete, who knows. The point is that it is better to keep your options open since the future is unknowable. Given two options it is better to learn X when it can do a, b, and c than to learn Z which can only to a, really well, because if a becomes obsolete at least you have b and c to fall back on. Ruby, a programming language, can do nearly anything. Rails, a framework, is much more restricted. Generally it is a bad idea to sacrifice future productivity for gains now, unless you have a short life expectancy.

    9. Re:Fad by mclaincausey · · Score: 1
      So you're expecting an application framework that adapts itself to any forseeable trend? Good luck with that. For the time being, any framework that is easy to adapt will have to do, at least for those of us living in the real world.

      Any Turing complete language is adaptable in some sense. And programming languages do indeed have to be adapted, and that adaptation requires work. That's why you write libraries, and why features are added over time.

      --
      (%i1) factor(777353);
      (%o1) 777353
    10. Re:Fad by DysenteryInTheRanks · · Score: 5, Funny

      we know for sure that the serving web pages won't be a problem for all time

      Very, very true. When the robots finally rise against us, we will be more concerned with finding shelter from the HoverDrones and their menacing gatling cannons and scavenging food not burned by the fearsome robot fire brigades! Instead of writing CRUD apps, we'll be crawling through sewers with radiation burns, hoping to reach the central meeting point for the remnants of the human resistance.

      Massive raditiation from the nuclear explosions will make the mere thoght of a WiFi, WiMax or cellular Internet connection laughable, and the network will in any case have been repurposed by the robots for their own genocidal ends, a grimly ironic rebuke to the original vision of the Internet as an Apocalypse-proof ARPAnet. And in any case, we'll be a tad more concerned with using baseball bats and snowshovels to bludgeon down waves of robots before they reach our cowering families! Rapid development of Web applications will be a bit of an after thought, no?? HaHA, HuhHAAA!

      When deciding whether to starve or to feast on the remains of one's robot-electrocuted best friend, HTTP cookies will tend to be far from one's mind, eh mate!?!? HA!

      As our once-proud cities burn into molten pools of blood and steel, watched by cold eyes of robot-controlled satellites in heliosynchronous orbit and encircled by robots in rupurposed tanks and SUVs, bearing shoulder-launched rockets, "serving web pages" will be the LEAST of our problems, and we will rue the day we thought of the web AS ANYTHING BUT A FAD!! MWHAHAHA!!!! ... or is that not what you meant?

    11. Re:Fad by misleb · · Score: 4, Insightful

      Ok, so basically what you are saying is that we should only learn programming languages on a very academic level and never learn to apply them to specific problems because some day those problems will no longer be problems and all of our time learning to apply the language in will be wasted. Do I understand you correctly?

      I can tell you this, if it weren't for Rails I would never have learned Ruby in the first place. Writing Rails applicaitons gives me a chance to learn a whole lot more than just the specific details of the framework. No only have I learned Ruby, but I've been introduced to test driven development and other good practices that were nowhere in the PHP world. It was actually the unstructured PHP world that I have found to be a waste of time.

      -matthew

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    12. Re:Fad by tcopeland · · Score: 1

      > you can create AJAX-based Web applications very easily with RoR

      Right on. Ditto with RJS - we're using them on the indi site (click the comments section to see it in action) and they work nicely. A very little bit of Ruby code gets you the Javascript functionality you want. And Rails' architecture seems to make that sort of thing easy to add.

    13. Re:Fad by killjoe · · Score: 1

      Interesting. You are saying that we should not learn or use rails because the web is going to die any day now.

      Interesting prediction there. DO you have a date in mind? When will web development die?

      --
      evil is as evil does
    14. Re:Fad by jaydonnell · · Score: 2, Insightful

      Almost every problem that someone solves is a "passing fad" by your definition. Why learn how to build bridges when we will have flying cars one day? The reason is that learning how to solve an immediate problem well, i.e. serving web pages, will help you know how to solve other, future, problems. Learning rails helped me understand what good clean code should look like. This will help me with any coding problem I try to solve in the future.

    15. Re:Fad by tcopeland · · Score: 1

      > As our once-proud cities burn into molten pools of blood and steel [...]

      Lyrically put sir, well done indeed!

    16. Re:Fad by Decaff · · Score: 2, Insightful

      There's no reason to assume that Rails will fail in the near term. Rails is based on a method of decomposing software functionality that does back to the 1970s (Model-View-Controller). Rails might not be here forever, but it has a very solid architectural foundation and it is easy to adapt it to the latest trends (for instance, you can create AJAX-based Web applications very easily with RoR). In other words, the extensibility and architecure of Rails make it adaptable, just as you mention Ruby being adaptable.

      This may be true, but Rails is also based on an approach to object-relational mapping (Active Record) that is not widely used and with only limited applicability. It assumes that the database schema is the centre of the data model. This is a very narrow view of data. Increasingly data comes from other sources than relational databases. To see how sophisticated this can get look at Xcalia - a Java product that can persist and retrieve data from just about anything - LDAP, XML, Databases - even SOAP services. Although I am no Microsoft fan, they are heading the right way with their new LINQ persistence system on .NET that allows querying and persistence to almost anything including in-memory objects. ActiveRecord is a very neat implementation of a very old-fashioned approach.

    17. Re:Fad by tcopeland · · Score: 1

      > It assumes that the database schema is the centre of the data model.

      Hm, although, the folks from salesforce.com wrote a ActiveRecord adaptor to their web services. So AR may be a bit more flexible than your post indicates...

    18. Re:Fad by achacha · · Score: 1

      I think there is a date already set for the apocalypse, so we can just use the same date and recycle the poster boards.

      RoR is a nice addiction to small web site development and lets you build a functional in a shot amount of time. The main downfall I see is the tight coupling to the relational database and mediocre performance. Ruby as a language is quite nice.

    19. Re:Fad by Decaff · · Score: 1

      "It assumes that the database schema is the centre of the data model.

      Hm, although, the folks from salesforce.com wrote a ActiveRecord adaptor to their web services. So AR may be a bit more flexible than your post indicates...


      No, it isn't - not really. The issue is that your data model is determined by one source - it doesn't matter if this is a web service, or if it is a relational database.

      A data model should be independent of the mechanism of persistence. You should be able to persist the same data model to web services, databases, XML and so on. ActiveRecord still says that the database is defined by the particular schema, no matter what the mechanism of persistence. This is the backward step. Your software is data-driven, not model-driven - change the data and your program breaks, and does so unpredictably. This is why most ORMs have a separate mapping layer, which protects against this.

    20. Re:Fad by Anonymous Coward · · Score: 0

      By the same reasoning, I should not take the time to get a driver's license, since we will all be flying around in hover crafts soon anyway.

    21. Re:Fad by tcopeland · · Score: 1

      > You should be able to persist the same data model
      > to web services, databases, XML and so on

      If you need that functionality, yes. If you only need to write to/from a specific persistence mechanism, then using a good solution for that persistence layer may be a good way to go.

      > This is why most ORMs have a separate mapping layer, which protects against this.

      I'd submit that many web apps don't need really this layer and that, in many cases, introspecting the DB like AR does is plenty good enough.

      Anyhow, not to thrash this out too much, just wanted to make the point that AR adaptors can be written for something other than a relational DB.

    22. Re:Fad by killjoe · · Score: 1

      Interesting observations. I have two questions though.

      1) Are you advocating the use of object oriented databases or plain files instead of relational databases?
      2) Since ruby on rails already powers sites that get thousands of hits per minute it seems to me that it would be perfomant enought for 99.9% of most web sites out there. Was there some specific web site you wanted to build?

      --
      evil is as evil does
    23. Re:Fad by Decaff · · Score: 1

      "> This is why most ORMs have a separate mapping layer, which protects against this."

      I'd submit that many web apps don't need really this layer and that, in many cases, introspecting the DB like AR does is plenty good enough.


      The thing is, it leads to fragile code. Changes in a schema lead automatically to changes in code, which are potentially hard to trace, as they happen only at run time. Also, it can seriously inhibit portability, as schema changes are almost always necessary to some extent when switching between different database products.

      Sorry, my opinion is that introspecting the DB (or any persistence mechanism) at run time is a seriously bad idea, for many reasons.

      Anyhow, not to thrash this out too much, just wanted to make the point that AR adaptors can be written for something other than a relational DB.

      I think it does need to be thrashed out :)

      The reason is that too many are seeing Rails as some wonderful total solution to all kinds of problems, without a real critical look at its potential problems (and it does have some!).

    24. Re:Fad by Anonymous Coward · · Score: 0
      The point is that it is better to keep your options open since the future is unknowable.
      so not knowing anything is keeping your options open? what are schools teaching you idiot kids these days?
    25. Re:Fad by finnif · · Score: 1

      There's no reason to assume that Rails will fail in the near term. Rails is based on a method of decomposing software functionality that does back to the 1970s

      Yeah, and in the 70s they thought disco and Sonny and Cher were cool. Need I say more?

    26. Re:Fad by arevos · · Score: 1
      I would invest time and money in Ruby on Rails, except that it is obviously a passing fad. This is because Rails is designed to solve a specific problem (serving web pages), and we know for sure that the serving web pages won't be a problem for all time.

      This is one of the strangest reasons I've ever heard for not learning Ruby on Rails. Whilst the web may eventually be replaced by another system, I see no indication that this will happen any time soon. Certainly a number of firms believe it will be around long enough to invest heavily in web-based applications.

      And surely your argument applies to any technology. Any library, language or framework can become obsolete. Would you advocate not learning at all, for fear that any knowledge learned becomes passe and useless?

    27. Re:Fad by Jicksta · · Score: 1

      "This implies that one has to work to adapt Rails to new situations. You would not say the same thing about a programming language."

      Are you even a web developer? You're defending programming languages by saying that they allow for future changes simply because algorithms are written with them, but you then turn around and call Rails unadaptable to "new situations" because it has an API.

      Last I checked 100.0% of the dynamic content web developers out there actually use an API of some kind. It's lunacy to call a platform flawed because its API doesn't work with what's smokin' hot in 2011.

      On this note, what are these "changes" around which you've built your entire case? What, ten years from now we'll be using port 1337 instead of port 80? Carrier pigeons will relay data? The speed of light changes?

      Take the FUD elsewhere.

    28. Re:Fad by colmore · · Score: 1

      So do you not know any libraries or frameworks in other languages? Do you write your own printf since, sooner or later that'll change too. Do you use DirectX /OpenGL or do you directly address VRAM? I don't think anyone is arguing for learning a framework (rails) without knowing the language (ruby). In fact that's what the book in question is about: learning the underlying language.

      --
      In Capitalist America, bank robs you!
    29. Re:Fad by gigahawk · · Score: 2, Informative

      Decaf this is the same thing you say on every rails thread. Rails is an 80% solution. Screw portability it is not a serious problem to most people. I don't know any companies who are switching database vendors more than once every 4 or 5 years, and when they do it's because they are writing a new application. This is the real world, who cares? We already have many tools written in ruby for consuming and modifying data from outside services and they work just fine in rails. This is not a "problem", this is a restriction by design. Rails is designed to do one thing only and one thing well. Respond to HTTP requests by serving data which is persisted into a database. This is how it was designed and this is how it is advertised. If the design and purpose changes later then we can debate the merits of pluggable persistence layers and portability. Introspection is not some magical black box that needs to be controlled and contained. Databases have the functionality so that applications can use it. Why on earth would I want to create my entire schema in the database and then redo it in some other language or format when the database provides the services to know information about it already? Seems a little wasteful to me.

    30. Re:Fad by gigahawk · · Score: 1

      I'm pretty sure that responding to requests over the HTTP protocol and being able to easily access databases is here to stay. Rails can send out any data it wants meaning that it's simply the easiest of the MVC web application frameworks. I'm pretty sure web applications are here to stay for quite some time. That is all.

    31. Re:Fad by mini+me · · Score: 1
      The main downfall I see is the tight coupling to the relational database

      Your models don't have to inherit from ActiveRecord. They could just as easily be an interface to a flat text file or a RPC. As long as you maintain the same interfaces, the application won't even know the difference.

      But a relational database is almost always the right tool for the kind of application Rails is designed for, so it seems logical that it is most predominant.
    32. Re:Fad by tcopeland · · Score: 1

      > Sorry, my opinion is that introspecting the DB (or any
      > persistence mechanism) at run time is a seriously bad idea, for many reasons.

      Ah, well, in that case, you're definitely unlikely to be happy with AR :-). Well, anyhow, best of luck!

    33. Re:Fad by theaem · · Score: 1

      I'm sure you haven't learned how to drive because it is a fad. I mean, who knows what we will be using for transportation in a few years? Sorry but if you can't see the trend I can't really help you.

      AEM

    34. Re:Fad by Decaff · · Score: 2, Informative

      Ah, well, in that case, you're definitely unlikely to be happy with AR :-). Well, anyhow, best of luck!

      Indeed :)

      It is a shame that AR has such publicity when there are far better approaches, in Ruby, which could have been used in Rails instead, like Og.

    35. Re:Fad by killjoe · · Score: 1

      "The thing is, it leads to fragile code. Changes in a schema lead automatically to changes in code, which are potentially hard to trace, as they happen only at run time."

      I have never used any framework where changing the schema didn't lead to all kinds of problems. Rails is actually more resilient then most because objects automatically morph with the change and with frequent use of iterators it drastically reduces the amount of code that needs to be fiddled with.

      --
      evil is as evil does
    36. Re:Fad by thevoice99 · · Score: 1

      If we assume most programs are written to make money, rails gives you a faster return on investment by allowing faster development on a problem that is trying to be solved today. This is why rails is good at what it does, it says no to solving everyone's problems and tomorrows problems. If you need to solve a problem that rails doesn't for you already, there is always Ruby to catch you.

    37. Re:Fad by Decaff · · Score: 1

      I have never used any framework where changing the schema didn't lead to all kinds of problems. Rails is actually more resilient then most because objects automatically morph with the change and with frequent use of iterators it drastically reduces the amount of code that needs to be fiddled with.

      No, it is the other way around. Rails less resilient because objects automatically morph with the change. This automatic morphing is the aspect of Rails ActiveRecord that I consider to be both uncessary and dangerous. A resilient framework should be able to detect schema changes and isolate code from them, not automatically morph objects. Of course other frameworks have problems with a schema change, but at least with many of them you can detect schema changes and how they impact the rest of the code.

      Surely a better approach would have been for Rails to generate Ruby source (or some other representation - even (horrors!) XML) from a schema, and then to introspect this source and the database when an application starts (or when a table is first used) in order to warn of changes. Of course, recent versions of Rails may do this, in which case I have far few objections to it.

    38. Re:Fad by MrTrick · · Score: 1

      When will web development die?

      When Netcraft confirms it!

    39. Re:Fad by mini+me · · Score: 1
      warn of changes


      Your tests (you are writing tests, aren't you?) will already catch any problems that arise from changing the schema. Unless of course your production database just changes at random. In which case you've got way bigger problems.
    40. Re:Fad by tcopeland · · Score: 1

      > like Og.

      Nice! Don't hear too much about Og or Nitro, although some of the folks on the Ruby list are big fans. Definitely nice to have choices out there...

    41. Re:Fad by killjoe · · Score: 1

      Well those types of frameworks already exist. J2EE immediately comes to mind as well as hibernate, ibatis etc. The rails people have produced an alternative to those types of frameworks because they didn't want to define something in two places (or three or four or five or sixteen). In other words it's not a bug, it's a feature.

      If you don't like that feature of Rails then it's not for you but DRY is a major selling point of rails. It sounds like you would be more comfortable with J2EE.

      --
      evil is as evil does
    42. Re:Fad by CableModemSniper · · Score: 1

      I'm pretty sure he was complaining about the "tight coupling" part, not the relational database part. You can't really use an AR oriented DB for anything but an AR app. Which is ok if you think of the DB as "magic persitance layer land" for my web app.

      --
      Why not fork?
    43. Re:Fad by Anonymous Coward · · Score: 0

      Hey, Sonny just went off the rails when he hit that tree. Don't blame Ruby and don't blame Cher.
      Don't blame the 1970s either it produced Bill Gates and DOS mutually exclusively!

    44. Re:Fad by Anonymous Coward · · Score: 0

      I think Rails gives structured PHP(5) more of a run for its money than unstructured (or procedural) PHP.

    45. Re:Fad by pilkul · · Score: 1
      a grimly ironic rebuke to the original vision of the Internet as an Apocalypse-proof ARPAnet

      Ha! One of the rare slashdot funny-modded comments that actually contains cleverness. I salute you, sir.

    46. Re:Fad by achacha · · Score: 1

      1) Are you advocating the use of object oriented databases or plain files instead of relational databases?
      I am merely stating that the RoR designs tend to tightly couple the site to the DB schema, which makes it tougher to convert to new schemas and to other database types (not impossible, just a bit tough and tedious). This is only problematic when you use large DB clusters which get refactored for performance. I would say for 90% of the sites, this is not an issues, but I am used to dealing with sites that get billion+ hits per day so every ounce of performance you get out of the DB helps a lot, which makes the coupling with rails a bit tricky. We use RoR as a back end so it's not dealing with the billion+ hits per day but as the front end and db backend changes the RoR backend has to keep changing which is a bit tedious at times.

      2) Since ruby on rails already powers sites that get thousands of hits per minute it seems to me that it would be perfomant enought for 99.9% of most web sites out there. Was there some specific web site you wanted to build?
      While 1000/min or ~1.5mil/day is low volume, if that site got /.'d it will fall to its knees. I've work on sites that get 1bil+ hits per day and RoR in initial tests was way too slow and java is just barely admissable given you throw enough machines at the problem (which brings the cost of space/heat/electricity to ugly levels). While I prefer C++ as language of choice for front-end web applications, I do realize that there is not enough C++ talent in the world, so Java is the next best thing for many cases. RoR is still in the infancy and it is a good way for a small site to get up and running quickly with very little hassle, but given all that niceness you can't kid yourself into thinking the site will scale well as the traffic increases substantially.

      I do find RoR very useful for quick prototypes and back-end admin sites to C++ front end sites, since it is a bit more work to get C++ code developed and running, it's nice to build the admin backend quickly (since performance is not an issue there).

    47. Re:Fad by killjoe · · Score: 1

      If you are running a billion hits per day then ROR is probably not good enough for you. As you said even Java is barely good enough.

      I do pity your staff if they are maintaining a web site like that in C++ though. I would hate to be them for sure.

      Anyway it's good enough for most of us. The ROR guys readily admit that it's not suitable for everybody. I for one think that writing a web site from day one to handle a billion hits per day is premature optimization of the worst kind. When you think about it a billion hits a day would require all kinds of architecture decisions and virtually no syncronous processing at all. That's a very tall order indeed. You could (and should) spend the first six months to a year doing nothing but planning in order to build a site like that no matter what language or framework you chose.

      ROR is for people who want to build web sites that can take a moderate to heavy load. If your site becomes so popular that it crushes ROR then you will have to migrate to something else. Hopefully by then you have lots of money to spend on help.

      --
      evil is as evil does
    48. Re:Fad by Nefarious+Wheel · · Score: 1
      ...because its API doesn't work with what's smokin' hot in 2011...

      Hi. I just got back from 2011, and we don't use RoR any more. I came back because my head chip was based on it and my GF is upset because my web pages don't fit in her small-format stack. Anyone got the source RNA here?

      --
      Do not mock my vision of impractical footwear
    49. Re:Fad by JavaIsGreat · · Score: 1

      Absolutely true. I do not see it adaption in enterprise computing in near future. I am working on J2EE for last 5 years, and can comfortably say that this is the most suitable technology for enterprise application. The reason is that prior to J2EE we really used to do some very expensive stuff to develop distributed enterprise application like banking, trading, credit cards. J2EE has its short comings but atleast it delivers a pretty goot reference architecture. The same can be said about .NET. The only problem with .NET is its marriage with Windows. If MS can open it then it will shoot like anything. Rest like RoR, Python, Perl are good for specific purposes but not comparable to reference arhitectures like J2EE or .NET.

    50. Re:Fad by kahei · · Score: 1

      ...i'm scared now. :(

      --
      Whence? Hence. Whither? Thither.
    51. Re:Fad by achacha · · Score: 1

      The sites are up and running and there is quite a lot of network planning that goes on before.

      Actually most of the people I deal with prefer C++ since they understand what is involved in running mega sites without being overwhelmed by hardware. Most people, when thinking of C++, think CGI, but that is not the case anymore. There are a few very capable C++ base app servers on which you can write solid business objects and application code. There are plenty of good C++ developers out there, the real problem is when companies decide to grow staff at alarming rates and can't find enough so they get java programmers or others not familiar with C++ programming (read as off-shore people who claim they know everything and in essense know very little) and those developers make the critical mistakes that can cause problems in the long run (like memory leaks and corruption). Remember that most mission critical applications are written in C/C++ (browsers, operating system, huge sites, et al).

      It is also not fair to compare RoR to C++ driven sites (comparing a commuter car to a race car, each has a use and you don't commute in a race car and you don't win races in commuter cars; but you can try in eitehr case). RoR is good for many medium/low volume applications and those account for a large percentage of the problems.

    52. Re:Fad by nine-times · · Score: 1

      Your very wording however reveals the difference that I am driving at. Consider "the extensibility and architecure of Rails make it adaptable". This implies that one has to work to adapt Rails to new situations. You would not say the same thing about a programming language.

      Rails isn't a programming language. It's a framework, and yes, it is aimed at a particular situation. It's aimed at web developers who want to be able to make web applications. If you're a web developer wanting to make powerful, versatile, and maintainable web applications with the best of today's technologies, it's quite a nice tool.

      However, I suppose you're correct if you're implying that it's not so good for making ice cream.

    53. Re:Fad by Anonymous Coward · · Score: 0

      OK, so basically what you are saying is that you can't do shit without handholding? It's nobody's fault, but yours, that you can't achieve something in a language without premade everything. Idiot. People like you give PHP a bad name.

    54. Re:Fad by kchrist · · Score: 1

      What does Rails have to do with Ajax? Yes, Rails includes the Prototype JavaScript library and makes Ajax easy, but there's no intrinsic connection.

      And when Ajax is passe? No problem, you will still be able to take whatever the latest-and-greatest thing is and serve it up via a Rails app, just the way you can serve up an Ajax application using a Java app or old Perl CGIs or whatever.

    55. Re:Fad by MoeDrippins · · Score: 1

      > Ok, so basically what you are saying is that we should only learn programming languages on a very
      > academic level and never learn to apply them to specific problems because some day those problems
      > will no longer be problems and all of our time learning to apply the language in will be wasted.
      > Do I understand you correctly?

      If you understand him at all, it's because it's essentially YOUR premise.

      > I would invest time and money in Ruby on Rails, except that it is obviously a passing fad.
      > This is because Rails is designed to solve a specific problem (serving web pages),
      > and we know for sure that the serving web pages won't be a problem for all time.

      So, YOU aren't going to spend any time learning Rails since the "...time learning to apply the language in will be wasted...", since "...serving web pages won't be a problem for all time..." ?

      --
      Before you design for reuse, make sure to design it for use.
    56. Re:Fad by Decaff · · Score: 1

      Your tests (you are writing tests, aren't you?) will already catch any problems that arise from changing the schema. Unless of course your production database just changes at random. In which case you've got way bigger problems.

      One of the golden rules of development is that you can't predict what data people will throw at your code. However, with Rails/ActiveRecord you can't even predict what your code is! The tests you would have to write are phenomenal - you would have to check for the continued existence of every field of every class generated from database tables.

    57. Re:Fad by Decaff · · Score: 1

      Well those types of frameworks already exist. J2EE immediately comes to mind as well as hibernate, ibatis etc. The rails people have produced an alternative to those types of frameworks because they didn't want to define something in two places (or three or four or five or sixteen). In other words it's not a bug, it's a feature.

      If you don't like that feature of Rails then it's not for you but DRY is a major selling point of rails. It sounds like you would be more comfortable with J2EE.


      Sorry, but this is wildly out of date. J2EE can be just as DRY as rails. Rails is competing with what J2EE was years ago, not what it is now. For example, with Hibernate and with other ORMs used with J2EE, you can generate you Java classes from a database schema (or part of that schema). However, unlike Rails, this is only done when you request it. Also, there are tools with these ORMs that allow the generation of schemas from your java classes. This is a superb feature, as it means you can automatically generate optimised schemas for just about any database without changing a single line of your code. I would claim that this is even more DRY than Rails, as not only do you define things in one place (your class files) for one database, you define them once for any future database you use. This is not the case with Rails, as use of different databases may require different column name conventions and changes.

      I use this feature all the time - my code can run without change on PostgreSQL, MySQL, Oracle, SQL Server, DB2 and so on.

    58. Re:Fad by killjoe · · Score: 1

      "Sorry, but this is wildly out of date. J2EE can be just as DRY as rails. "

      No it can't. As you said you need a mapper file to map your database to your objects.

      "For example, with Hibernate and with other ORMs used with J2EE, you can generate you Java classes from a database schema (or part of that schema). However, unlike Rails, this is only done when you request it."

      Once again that's precicely the point. Class generation has been around for decades now. Rails specifically didn't want to do that.

      "This is not the case with Rails, as use of different databases may require different column name conventions and changes."

      It's becoming obvious to me that you have never used rails or even ruby. In rails you can create all the mappings you want. You just do them in your class instead of an external file and you do them only if you want to rename a field. You can can even attach to different databases at runtime. For example if you have a activerecord defined as people but you have 50 databases (one for each client let's say) when you instanticate the people object you can attach to any database you want.

      I think you really should use the framework before making remarks about it. It's clear that you are simply talking out of your butt.

      --
      evil is as evil does
    59. Re:Fad by mini+me · · Score: 1
      The tests you would have to write are phenomenal

      Not at all, it's entirely implicit. As your application runs through the tests, the missing methods will raise an exception. It's no different than removing a method that exists right in the model.

      Database schemas don't just change at random. To do it the Rails way you even have to write a Ruby script (a migration) to upgrade the database. If you've gone to all that trouble, surely you'll be able to figure out what needs to change in the application.
    60. Re:Fad by Decaff · · Score: 1

      No it can't. As you said you need a mapper file to map your database to your objects.

      In those ORMs that do, it can be generated for you - either from your schema or your classes. You need not touch it yourself. In many ORMs (such as JPA) you need no mapping file at all.

      Once again that's precicely the point. Class generation has been around for decades now. Rails specifically didn't want to do that.

      No, you are missing the point. Class generation has been indeed around for decades. But the modern approach is to define your data as classes and have schema generation (or something called 'meet in the middle', where schema and class definitions interact). Rails gets it the wrong way round - the relational database is a very poor place to define object models - this was a lesson learned decades ago (but apparently, not learned by Rails).

      It's becoming obvious to me that you have never used rails or even ruby.

      Nice to know you are a mindreader :) You are wrong.

      In rails you can create all the mappings you want. You just do them in your class instead of an external file and you do them only if you want to rename a field. You can can even attach to different databases at runtime. For example if you have a activerecord defined as people but you have 50 databases (one for each client let's say) when you instanticate the people object you can attach to any database you want.

      You are missing the point yet again. Of course, you can do all sorts of things with Rails - it is extremely easy to customise anything (that is one of the great things about Ruby). Of course you can create mappings, but this does not help, for example, suppose someone creates additional fields - your mapped classes will pick those up automatically. Your code is still vunerable to schema changes in ways that more robust ORMs aren't. As shipped, and as intended to be used, Rails is fragile.

      I think you really should use the framework before making remarks about it. It's clear that you are simply talking out of your butt.

      I have used it, and I have researched it in detail. I have a habit of actually researching technologies I comment on. I think you need to take a much deeper look at other technologies (especially modern JDO 2.0 implementations like Kodo, and associated tools) before posting again - you will find some awesome stuff - the ability to define queries in portable languages, and like really high performance transaction handling.

    61. Re:Fad by Decaff · · Score: 1

      Not at all, it's entirely implicit. As your application runs through the tests, the missing methods will raise an exception. It's no different than removing a method that exists right in the model.

      This just doesn't work effectively for substantial applications (at least in my experience). You can't test all parts of all the code all the time - this effectively removes the agility of Ruby.

      Database schemas don't just change at random. To do it the Rails way you even have to write a Ruby script (a migration) to upgrade the database. If you've gone to all that trouble, surely you'll be able to figure out what needs to change in the application.

      Databases don't always change that way. It is a very simplistic view to consider that you will have control of all uses of the database, and will be the one who defines what happens and when. It is typical for your application to be just one of several that use a particular database. Figuring out what needs to change may be straightforward, but locating all those changes and updating the code can be a major exercise. Far simpler to is have a mapping between classes and database to allow these changes to be made in one place - the DRY approach.

    62. Re:Fad by killjoe · · Score: 1

      "But the modern approach is to define your data as classes and have schema generation (or something called 'meet in the middle', where schema and class definitions interact). Rails gets it the wrong way round - the relational database is a very poor place to define object models - this was a lesson learned decades ago (but apparently, not learned by Rails)."

      Rails can do that. It's called migrations. You should look into it. They are really cool. Once again you need to learn about the thing your are pissing on because it makes you look stupid when you claim something that isn't true.

      "Of course you can create mappings, but this does not help, for example, suppose someone creates additional fields - your mapped classes will pick those up automatically. Your code is still vunerable to schema changes in ways that more robust ORMs aren't. As shipped, and as intended to be used, Rails is fragile."

      Again that's the whole point of rails. That's a feature not a bug. So you add five fields now what? Sure activerecord knows about them but since none of your other code is aware of them the fields are never called. No harm no foul.

      "I have used it, and I have researched it in detail."

      I don't believe you.

      "I think you need to take a much deeper look at other technologies (especially modern JDO 2.0 implementations like Kodo, and associated tools) before posting again - you will find some awesome stuff - the ability to define queries in portable languages, and like really high performance transaction handling."

      No thanks. I have given up Java for good. I am not going back ever. You can keep it. I refuse to code in it again either for pleasure or for a job. Lucky for me I don't have to.

      --
      evil is as evil does
    63. Re:Fad by killjoe · · Score: 1

      I just got done reading an article where ROR was able to handle 1.1 million hits per day. So if you think your web site will need less then 1 million hits per day then the increased productivity of ROR is probably worth it.

      If you think you will need more then 1.1 million hits per day then you are probably better off going to something else (for now anyway).

      --
      evil is as evil does
    64. Re:Fad by mini+me · · Score: 1
      It is a very simplistic view to consider that you will have control of all uses of the database, and will be the one who defines what happens and when. It is typical for your application to be just one of several that use a particular database.

      Typical, perhaps, but it's not the Rails way. Your database should be exposed via a web service API, such as that provided by the forthcoming ActiveResource, if other applications need to access the data. Anything less means that you're repeating your business logic.

      And of course, if ActiveRecord isn't the right tool for the job, use something else. Perhaps Og is more up your alley?
  5. For the love of... by Anonymous Coward · · Score: 1, Funny

    My boss is a buzzword-whore w/o english knowledge... and I can really imagine him how he'll do the locomotion when he'll talk BS about "Ruby for Rails" because he has seen it on top of some important-could-be Slashdot article...

    I work in hell!!!

    1. Re:For the love of... by Ingolfke · · Score: 1

      Maybe you wouldn't have to work such long hours in hell if you'd get your job done instead of posting to /. you lazy sack of broker transistors and sludge.

    2. Re:For the love of... by jocknerd · · Score: 1

      Whats worse, a boss who is a buzzword whore, or a boss who only knows what IBM tells him to know and if you bring up anything else (ie. RoR, Subversion, etc.), it must be junk. We're so much in the pocket of IBM, that we don't run Apache, we run IBM's HTTP Server, which IS Apache but of course, our version is equivalent to a 4 year old version of Apache. But we use IBM's version because we like to pay out of our asses for support.

  6. actually by aleksiel · · Score: 5, Informative

    i went to purchase a rails book the other day and gave this book and the book "Agile Web Developent with Rais" and found the agile development book to be better, imho. and $10 cheaper.

    1. Re:actually by tcopeland · · Score: 1

      > i went to purchase a rails book the other day and gave this
      > book and the book "Agile Web Developent with Rais" and found
      > the agile development book to be better, imho. and $10 cheaper.

      I think they serve different needs. Get the Agile book to learn how to build a Rails app, and then get Dr. Black's book to learn how Rails works under the covers.

    2. Re:actually by misleb · · Score: 1
      how Rails works under the covers.


      Like a professional!

      -matthew
      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
  7. Oh Ruby... by Penguinshit · · Score: 3, Funny

    Every time I see the name "Ruby on Rails" it reminds me of this coke-whore who lived in my college dorm...

  8. I knew it! by Mateo_LeFou · · Score: 1, Interesting
    I've been dodging the whole Rails gestalt, and I can't say exactly why. I watched that cute video where the guy puts together the blog in about 10 minutes, and I'm all "cool, okay". And I did that and woot!

    Then I decided to put together a blog that worked a little differently... and realized that to do so, I needed to spend a few months learning Ruby. not woot.

    Maybe I didn't stick with it long enough, but it just seems like another micromanaging "framework" to me.

    --
    My turnips listen for the soft cry of your love
    1. Re:I knew it! by misleb · · Score: 4, Insightful

      Are you being facetious? Or are you actually annoyed that you had to learn a programming language and a framework to do something useful with Rails? I can't tell.

      -matthew

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    2. Re:I knew it! by smart.id · · Score: 1

      I think you are missing the point of your parent poster. He is merely pointing out the fact that the video makes it seem like things can be done in 10 minutes; the people "advertising" Ruby on Rails are emphasizing the speed in which one can "bang out" some web app, like a blog. I cannot attest to how easy or hard it is do so, because I have never attempted myself. However, the video does make it look easy, with major catches - namely, learning the actual language, because one does not simply know from birth how to do everything he is doing to make his blog.

      --
      blog & fiction: jd87
    3. Re:I knew it! by misleb · · Score: 1
      However, the video does make it look easy, with major catches - namely, learning the actual language, because one does not simply know from birth how to do everything he is doing to make his blog.


      Why does this seem like such a "duh!" moment to me? Rails DOES make it easy to make things like blogs, but you'd have to be either extremely lazy or dimwitted to think that you could do it without learning something. I mean, you saw (in the video) that you actually had to input some Ruby code. Where did the grandparent poster think that code was coming from? Thin air?

      -matthew
      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    4. Re:I knew it! by Beek · · Score: 1

      When you are at your peak of efficiency with your preferred language/framework, are even close to that efficient? That should be the yardstick.

    5. Re:I knew it! by smart.id · · Score: 1

      Agreed -- but perhaps the Ruby people should have a disclaimer similar to the one on commercials for diet pills where they show a person losing 70 pounds in a month: "Results not typical."

      --
      blog & fiction: jd87
    6. Re:I knew it! by Not+The+Real+Me · · Score: 1

      LOL. You're right.

      When I look at the ROR real world sites http://wiki.rubyonrails.com/rails/pages/RealWorldU sagePage1 I would love to see some medium level (or higher) financial institutions on here. Then again many public utility companies (gas, electric, water, phone, and credit card companies as well) allow customers to pay and review their account online. The lack of these transaction heavy companies running ROR leads me to believe that the ROR evangelists do a great job hyping ROR but the big boys don't seem to be buying into the ROR self-promotion.

    7. Re:I knew it! by Watts+Martin · · Score: 1

      You mean it's been a whole seven months since the release of Rails 1.0 and Bank of America hasn't redone their entire website in it yet? My god, it's all been a sham! How could we have been so blind!

      LOL, indeed. Nobody has a frickin' clue how Rails 2.x, let alone Rails 3.x, is (or is not) going to change anything, whether we're talking about scalability or speed or new ORM approaches. Hell, we don't even know anything about the relative performance of Ruby 2.0's VM, presuming it chugs out of the gate in the next couple of years.

      All the Web 2.0 buzzwords being thrown about notwithstanding, d'ya think maybe we could, oh, wait a few goddamn years before writing Rails off as a failure?

  9. Soon to be obsoleted by Airways for Python by Outland+Traveller · · Score: 4, Funny

    Guido van Rossum was heard exclaiming that he was developing with SNAKES on a PLANE.

    1. Re:Soon to be obsoleted by Airways for Python by Dom2 · · Score: 1
    2. Re:Soon to be obsoleted by Airways for Python by Anonymous Coward · · Score: 0

      Wouldn't "Snakes on a Plone" be more appropriate?

  10. Re:Oh vey. by Ingolfke · · Score: 5, Funny

    I can't wait for the day ruby on rails loses it's buz and the infinite amount of Ruby on Rails has been derailed jokes.

    That's scheduled to occur in conjunction with Web 3.0. Ruby on Rails will be replaced with Pascalian Patterns a dynmaic, distributed, easy-to-use, personal lanuage based on Pascal.

  11. Not facetious by Mateo_LeFou · · Score: 1

    What that video reminds me of is e.g. a demoing a word processor or other document generator. Look, you open this template, fill out the fields in this wizard, and you've got a pretty, laid-out invoce you can print and send!

    Great unless your business is unusual in some way they hadn't predicted -- that is to say if your business has a significant, novel differentiation that sets you apart from all other business. That is to say: if your business is sound.

    I have no problem learning a programming language, but "frameworks" just send up a red flag for me. I'm sure there are great ones...

    --
    My turnips listen for the soft cry of your love
    1. Re:Not facetious by misleb · · Score: 1
      What that video reminds me of is e.g. a demoing a word processor or other document generator. Look, you open this template, fill out the fields in this wizard, and you've got a pretty, laid-out invoce you can print and send!

      Great unless your business is unusual in some way they hadn't predicted -- that is to say if your business has a significant, novel differentiation that sets you apart from all other business. That is to say: if your business is sound.


      Well, Rails is just a tad more flexible than a document wizard/template. The fact that they were inputting Ruby code into a text editor should have been a good indicator of that. Where did you think that Ruby code was coming from? Thin air? I'm sorry, but you have to be pretty dim witted to think that you could use Rails without learning something and writing some custom code of your own.

      I have no problem learning a programming language, but "frameworks" just send up a red flag for me. I'm sure there are great ones..


      And Rails is one of the great ones. There was nothing deceitful about the video you saw. It really is easy to throw together a blog-like site with Rails. But you still have too LEARN something. This is one of those "DUH!" moments my mother always told me about.

      -matthew
      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
  12. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  13. PONIES on RAILS!! by Anonymous Coward · · Score: 0

    yay, cute lil' ponies!!

  14. David Black at Big Nerd Ranch by bignerdranch · · Score: 1, Informative

    The author of this book will be teaching a class on Ruby/Ruby on Rails at Big Nerd Ranch, Aug 14 - 18:
            http://www.bignerdranch.com/classes/ruby.shtml
    Disclaimer - I work for Big Nerd Ranch, but I really do think the class is going to be great.

  15. Save $7.64 by buying the book here by Anonymous Coward · · Score: 1, Informative

    Save yourself $7.64 by buying the book here: Ruby For Rails. And if you use the "secret" A9.com discount, you can save an extra 1.57%! That's a total savings of $8.08, or 22.82%!

  16. wow, Simon by Anonymous Coward · · Score: 0

    You should give up writing. How did you graduate high school? Do you even know what a comma is? Do you know how to construct a sentence? Reading your review makes everyone dumber.

  17. RoR -- Made for Java Devs by fupeg · · Score: 2, Insightful
    For those of us who have developed web applications with Java, this is a welcome break.
    People like to think that RoR came from the same spring that produced Python and PHP. That might be true of Ruby, but not RoR. Nope, RoR is made for Java devs. That's why they make such a big deal about the lack of configuration. Java frameworks have a notorious amount of configuration. RoR is very natural for Java devs who are also used to MVC frameworks for web apps. It is not as compelling to PHP and Python developers, even though Ruby is a lot closer to those languages than it is to Java.
    1. Re:RoR -- Made for Java Devs by draed · · Score: 2, Interesting

      yeah this is a good point. I've tried to explain Ruby on Rails to both php developers and java developers and the java developers just get it.. they completely understand the benefits and usually fall in love with it.

      On the other hand, the php developers really have a tough time grasping the concepts behind RoR. I think this is mostly because they have ever seen a MVC pattern. They are so used to mixing all their business logic in with their HTML, it's hard to comprehend the benefits of RoR and using an MVC pattern for a web app.

    2. Re:RoR -- Made for Java Devs by Anonymous Coward · · Score: 0

      Except Java and Ruby (even with RoR) is in a different league all its own. RoR does NOT compete in the Java space.

    3. Re:RoR -- Made for Java Devs by outsider007 · · Score: 1

      I switched from php to RoR 6 months ago and My IQ actually went up by 7 points. You can't argue with that kind of success.

      --
      If you mod me down the terrorists will have won
    4. Re:RoR -- Made for Java Devs by eargang · · Score: 1

      You should start hanging out with more intelligent PHP developers. There's a difference between a developer and a PHP tinkerer. MVC is not a hard concept to understand.

    5. Re:RoR -- Made for Java Devs by eargang · · Score: 1

      Perhaps that's your perception, but the thing is that DHH was a PHP developer that grew frustrated with the language's limitations and kitchen sink attitude. The lack of configuration is not an indication that it's made for Java devs; any non-Java dev will perceive the low amount of config as normal. Rails just lets Java devs see how unnatural the huge loads of configuration settings were.

    6. Re:RoR -- Made for Java Devs by graznar · · Score: 1

      The main advantage to PHP programmers is structure and lack of SQL. If you've ever used PHP for web development, you get annoyed with SQL really quick (especially if you're doing complex updates). It's much simpler to use ActiveRecord to off-load all that stuff. There are other advantages, too, but that's the big one that I, as a former full-time PHP dev, see as the biggest.

      --
      [ check out my ruby book @ http://ww
    7. Re:RoR -- Made for Java Devs by draed · · Score: 1

      yeah. I realize that not every php developer is like that, but the vast majority are.

    8. Re:RoR -- Made for Java Devs by Anonymous Coward · · Score: 0

      Define "closer." Ruby and PHP are nearly nothing alike in any way that matters. It's an insulting comparison really, given that PHP is such a shocking example of "what not to do" when designing a programming language ;)

    9. Re:RoR -- Made for Java Devs by Anonymous Coward · · Score: 0

      You should start hanging out with more intelligent PHP developers

      Those are hard to find, as most have switched to other languages (like Ruby) by now.

  18. Actually a little facetious by uncadonna · · Score: 3, Funny
    --
    mt
  19. Slashdot - Where Rails gets the hype. by Qbertino · · Score: 2, Insightful

    Quit the hype allready. There are at least 3 oss web packages out there that are better in more than just a few aspects:
    django ( http://www.djangoproject.com/ )
    Symfony ( http://www.symfony-project.com/ )
    Zope ( http://www.zope.org/ )
    Zope is by far the oldest and most sophisticated. Django is Rails done right and in Python and Symfony is a PHP metaframework that includes Propel and some other third party goodies with tons of very neat PHP 5 foundation work. Each one of these kick Rails up and down the street when it comes to ease of use, ease of deployment, available documentation and performance (Zope may be a little slower, but they have a full-blownobject relational DB built in that makes SQL look like peek and poking a c64 back in 1985).
    And since the Ruby on Rails people use PHP to power their Rails website (oh, the irony; http://rubyonrails.org/index.php ) I'd trust in even PHP being able to perform more than good in the newest lineup of Frameworks.

    So quit the rails-only hype allready, it's anoying.

    --
    We suffer more in our imagination than in reality. - Seneca
    1. Re:Slashdot - Where Rails gets the hype. by Anonymous Coward · · Score: 0

      Zope isn't ANYTHING like Rails.

      Give Rails a spin and see what everyone's making hype about. I guarantee you haven't even downloaded it yet.

    2. Re:Slashdot - Where Rails gets the hype. by Sweetshark · · Score: 2, Informative
    3. Re:Slashdot - Where Rails gets the hype. by killjoe · · Score: 2, Insightful

      Django:
          Overall very nice. No capistrano, no migrations, no built in support the unit testing like rails. Great admin interface, very fast.

      Symfony:
              Don't know, never used it, never will because it's PHP and I don't like PHP anymore.

      Zope:
            Aaah zope. So much innovation, so much potential, so much going for it but in the end so hard to learn and use. Very slow. documentation not all that great. TTW design is a HUGE drain on productivity. No support to deployments. You can keep your stinkin migrations because we have a object oriented database. Testing is a pain. I actually like aquisition. It's great the security is built in. There are too many half asses, half finished, half functional products which all have weird dependencies on other broken products. Where are the gems or CPAN?

      I think zope is brilliant but I also think it's wasted potential. For some reason this great and innovative framework has not produced the likes of wordpress, sourceforge, a halfway decent bug tracking system, or anything else (except for plone of course). A good framework should produce great products and zope has failed in that.

      --
      evil is as evil does
    4. Re:Slashdot - Where Rails gets the hype. by Anonymous Coward · · Score: 0

      The only problem with those is that I dislike Python and I hate PHP, whereas I love Ruby. And, as others have pointed out, Zope isn't even in the same league.

    5. Re:Slashdot - Where Rails gets the hype. by Anonymous Coward · · Score: 0

      The main RoR website represents merely a collection of static pages without any significant dynamic content. I see no reason why such a site needs to be designed as a web application instead of a collection of PHP documents. The irony you cite represents acknowledgment from the developers that PHP is suited (at least) to a simple task such as this, while they continue to promote Rails as a (very different) application framework.

    6. Re:Slashdot - Where Rails gets the hype. by flipper65 · · Score: 4, Interesting

      Having just come off of a review of these exact frameworks for adoption at our firm I have to take exception with some of your statements. I will absolutely give you performance for all of these exceeding that of rails, however, ease of deployment (Capistrano for comparison),ease of use (have you really looked at Zope/Plone and tried to do anything really useful with it?), and, oddly enough, other than Zope, there is more documentation for rails than for either of the other two frameworks. I am including the three ruby/rails books that are currently available as rough cuts through O'Reilly's safari service.

      We settled on rails because it was faster to iterate and develop, the whole MVC design pattern just screams out to be used in database driven website design, and rails is just flat out more fun to work in than PHP ever was. Even if it turns out not to be the wave of the future, having worked in ruby using rails has already begun to teach our developers to think in terms of convention over configuration, standards and object orientation.

      Really, it's been a win for us. Also, the ruby for rails book is an outstanding read, I would also recommend enterprise integration with ruby as a good next step.

    7. Re:Slashdot - Where Rails gets the hype. by mzatko · · Score: 2, Insightful

      Rails ain't hype, as a fulltime Java programmer who got a little too curious, I can tell you that this is the real deal. I dislike people who discount other languages and frameworks just because it isn't their favorite framework they've been using. Attachment is an awful trait in the programming industry. I won't discount any of the frameworks you've mentioned because I simply havn't used them, but in comparison to Java frameworks I've used for many years, Rails blew them all away. I see a bright future for Ruby, Rails, and other Ruby based frameworks. On topic, this is a good book for those who have spent some time with Rails and want to dig into the underlying (and magnificent) Ruby language. I met David Black at a PhillyOnRails user group meeting and actually got a signed copy of his book. Good stuff!

    8. Re:Slashdot - Where Rails gets the hype. by moro_666 · · Score: 1

      I think he is more opposing the "silver bullet" hype. Ruby with rails or no rails is no silver bullet. RoR does give advantages, mostly to developers, can save time in some projects and be a great idea or at least provide groudn for great ideas to grow from.
        If you're a little bit experienced in how applications scale and how good the products of big brothers are in this (either java or dotnet) you can clearly see that ror is not an answer to everything. It just makes some stuff simpler, and in it's own place it's a really good thing. If ruby ever gets real threading, i'm sure i'll throw a look at it, but as long as it's threading model is the way it is, it's not really meant for everyone. But the hype looks like it should be. It isn't.

        As said zillion times on slashdot already, no language/platform/framework/developing-model is the ultimate thing, every item has it's own place in it's own corner, let's just try to keep the hype a bit down :)

      --

      I'd tell you the chances of this story being a dupe, but you wouldn't like it.
    9. Re:Slashdot - Where Rails gets the hype. by JavaIsGreat · · Score: 1

      If you are a full time java developer then why are you comparing RoR with J2EE. RoR is a framework for making web applications THATS IT. What is so big deal about that? J2EE is a reference architecture and you can make N number of web framework based on that, only you imagination is your limit. As a J2EE guy for last 6 years I have architected, designed and developed many applications of varying complexity and I can not design a single application of that type based on RoR. RoR is a tool for specific purpose like Python or PHP. Choose whatever suits your purpose and develop. What is so great about any specific tool/framework?

    10. Re:Slashdot - Where Rails gets the hype. by Anonymous Coward · · Score: 0

      Learn to spell allready - dork!

    11. Re:Slashdot - Where Rails gets the hype. by mzatko · · Score: 1
      *RoR is a framework for making web applications THATS IT.*

      Oops, no, you're wrong. It's not. Rails includes really nice Web Services support, making it more than just a "web page framework". Labelling it so is just Java fanboy ignorance. (I was the same way 6 months ago...) ROR will fit in nicely in a service oriented architecture, which is where my company is piloting it right now. Using ROR for web application development and wherever we require legacy integration (MQ, DB2 7 Stored Procs, etc.), we can call a Java web service. Not to mention Rails has the full power of the Ruby language and it's libraries... (Ruby is the real star, here)

      I like to point out where Java was a year after it's release... I'm betting that in a few years the Ruby movement will have grown quite considerably, but hey, I could be wrong and Java might reign supreme for the next 20 years.

    12. Re:Slashdot - Where Rails gets the hype. by mzatko · · Score: 1

      Is Ruby and Rails worth the attention of developers?.... Yes

      Is it a silver bullet?... NO

      The Rails core team is actually pretty open and vocal about Rails being designed to solve a niche problem. They believe that this focus is what will allow Rails to ultimately make the uber complex, try-to-solve-everything frameworks of Javaland seem utterly cumbersome.

      Anyway, Ruby does need maturity.. that's the one thing I see as Java's biggest advantage at this point, but I agree with DHH that the time to maturity for Ruby will be much shorter than it was for Java.

    13. Re:Slashdot - Where Rails gets the hype. by self+assembled+struc · · Score: 1

      I have to agree with this. Django, while underdocumented (again though, thanks to Mr. Spolsky's Law of Leaky Abstractions needing to go through the source to learn how something works is acutally a pretty good learning metaphore) is really the framework Rails should have been. Dynamically compiled models, complete decouplization from it's separate components (don't like the template system? use something else! or just write HTML to the output. or XML. or whatever), and thanks to the recent branch merge, a lack of "magic" which helps when you're trying to figure out why something didn't work when it was supposed to "just work."

      plus, the built in admin interface is super easy fgor getting stuff started, and while it does have some drawbacks, is still a pretty solid freebee that just doesn't exist anywhere else.

      and lastly I don't want to have to run another server. mod_ruby doesn't work correctly, and i'm already running apache2. i just run mod_python and don't have to worry about proxy requests or lighttpd configuration (or the problem with high loads and lighttpd/fastcgi interaction).

  20. Rails needs to be more mature by FooBarWidget · · Score: 3, Interesting

    I've tried Rails. It's pretty good, but it needs to be more mature because it lacks support for the more advanced stuff. Among the things that it currently (seem) to lack are:

    - Support for saving database records using database function. In other words, I want Rails to automatically perform a query that looks like this:
    INSERT INTO foo VALUES(NOW());
    I want to insert a record that uses the database server's time instead of the web server's time.

    Or, something like this:
    INSERT INTO foo VALUES('bar', INET_HTON('127.0.0.1')); --- notice the INET_HTON() part
    In this example, I want to store IP addresses as integers in the database.

    - Apache integration is still too immature. I don't know about Apache 1, but Apache 2 integration using FastCGI doesn't work *at all*. The documentation on the website about Apache integration is very messy: different pages suggest different things. After much research I found out that:
    (1) mod_fastcgi (not FastCGI itself, which is something else!) is dead, use fcgid instead.
    (2) Integration using fcgid doesn't work either!
    After a lot more research I found a working solution: make Apache proxy requests to a lighttpd server, which is running the Rails app. This doesn't seem like an ideal situation.

    - Documentation is still too immature. While the API references are pretty good, the Wiki is very messy (see Apache integration).

    1. Re:Rails needs to be more mature by draed · · Score: 3, Informative

      Mongrel is the latest and greatest to handle rails requests. http://mongrel.rubyforge.org/

      It's a http server written ruby(and c where speed matters) that is very easy to install and get up and running and performs as fast as lighttpd.

      What a lot of people are doing is setting up apache 2.2 to serve static pages, and proxy any rails requests to mongrel... There's no fastcgi/fcgid involved.

    2. Re:Rails needs to be more mature by Anonymous Coward · · Score: 0

      Just do it the same way you do in every other language... execute a SQL statement.

      You forget that Ruby has had plenty of time to mature. Rails is just a framework that makes Ruby easier to work with for web development, but all of the power of Ruby is still accessible.

    3. Re:Rails needs to be more mature by Decaff · · Score: 1

      Just do it the same way you do in every other language... execute a SQL statement.

      Fortunately, that is not the way you do it in every other language. SQL is notorious for its quirks and lack of portability, and using substantial amounts of SQL is a great way to make your app highly dependent on a specific database. Other languages use alternative methods of querying or SQL-like languages that are guaranteed to be portable, and are translated to efficient optimised SQL for whichever database you happen to want to use (such as the recently standardised JDOQL and JPAQL in Java).

    4. Re:Rails needs to be more mature by LDoggg_ · · Score: 1

      Just do it the same way you do in every other language... execute a SQL statement.

      Doesn't that defeat the purpose?

      I know it's a pain in the ass to keep up with every database, but lots of persistence frameworks go throw the trouble of writing in a layer of abstraction to handle the differences in database servers like (NOW,CURRENT_TIME,SYSDATE).
      Considering that RoR has gotten so much press, I assumed something this simple was part of it.

      --

      "If they have both, tell them we use Linux. And if they have that, tell them the computers are down." -Dave Chapelle
    5. Re:Rails needs to be more mature by lelio98 · · Score: 1

      RoR does do what you are talking about. One of it's best features is that it is designed to be completly database agnostic.

    6. Re:Rails needs to be more mature by 19thNervousBreakdown · · Score: 1

      What's wrong with mod_ruby that you're trying to use FastCGI?

      I know nothing about rails, does it not work with mod_ruby?

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    7. Re:Rails needs to be more mature by gigahawk · · Score: 1

      This is not a question of maturity for rails and more a question of design. You will never see things like this happen in rails for the entire life of the core product. Data persistence logic like this is a responsibility delegated to the the model of the data and not the database.

    8. Re:Rails needs to be more mature by colmore · · Score: 1

      - The documentation is provided by the community. Have you posted your apache configuration? Ruby is a much meatier program than Perl or Python or PHP and as a result, doing CGI the non-fast cgi way isn't an option. The fact that Apache has problems with fastCGI isn't the fault of Rails however.

      - I don't know how far into the API you've looked, but there are most definitely ways of using literal SQL statements rather than .save().

      - Yes the wiki could use some work, and this is something any rails fan can do to help the project. There sure seem to be a lot of fans, so what are people waiting for?

      --
      In Capitalist America, bank robs you!
    9. Re:Rails needs to be more mature by graznar · · Score: 1

      Uhhh...

      Support for saving database records using database function. In other words, I want Rails to automatically perform a query that looks like this...

      Create a column called "created_at" and Rails does it automatically according to which db adapter you're using. No function call (on your end) needed.

      - Apache integration is still too immature. I don't know about Apache 1, but Apache 2 integration using FastCGI doesn't work *at all*. The documentation on the website about Apache integration is very messy: different pages suggest different things. After much research I found out that

      I think the Agile Web Development with Rails book addresses this and I know that my book does, but either way that configuration is quickly becoming a thing of the past. FastCGI is slow, cumbersome, and hard to configure compared to using mod_proxy and pointing at a bunch of Mongrel (a Ruby/C based web server) instances. If you must use this setup, then look here: http://wiki.rubyonrails.org/rails/pages/FastCGI

      If you really want the best setup, look here and here.

      Documentation is still too immature. While the API references are pretty good, the Wiki is very messy (see Apache integration).
      Agreed and work is being done on that, but don't discount Rails because of the bad wiki. Hit up Planet RubyOnRails, Planet Ruby, and RubyCorner: Ruby blogs are where the info is. If you like what you see, shell out the money for one of the books. I don't know if Ruby for Rails is a great place to start, but however you think you'll learn best, go with it: learning the language first (Ruby for Rails), learn the language from the framework (Agile Web Development with Rails), or a quick (50~ page)run through and then Rails (Mr. Neighborly's Relevant Ramblings, Thoughtful Theories, and Pointed Pontifications on Ruby and Rails -- my book).

      -Jeremy

      --
      [ check out my ruby book @ http://ww
    10. Re:Rails needs to be more mature by crayz · · Score: 1

      As someone who tried for a good couple months to make FastCGI work properly for a production app that needed reliability, mongrel has been a savior. I love Rails, but was beginning to think it was unworkable for anything important because of FastCGI's(specifically mod_fastcgi's) flakiness

      The only real downside is the bleeding-edge technology needed(i.e. Apache 2.2 w/ mod_proxy_balancer)

    11. Re:Rails needs to be more mature by FooBarWidget · · Score: 1
      "What's wrong with mod_ruby that you're trying to use FastCGI?"


      I did a lot of research trying to figure out why the wiki usually recommend FastCGI instead of mod_ruby. Try reading this! I quote:
      "Having 100 Apaches with 10 FastCGIs will use only 800MB of memory while having 100 Apaches each containing mod_ruby process can easily use 3GB of memory."

      So no mod_ruby.
    12. Re:Rails needs to be more mature by FooBarWidget · · Score: 1
      Create a column called "created_at" and Rails does it automatically according to which db adapter you're using. No function call (on your end) needed.


      Are you even talking about the same thing? I'm talking about queries like this:
      INSERT INTO foo VALUES(INET_ATON('127.0.0.1'));
      and notice the INET_ATON part. I'm not talking about calling database functions from Ruby, I'm talking about SQL procedures inside the database server.
    13. Re:Rails needs to be more mature by FooBarWidget · · Score: 1
      - I don't know how far into the API you've looked, but there are most definitely ways of using literal SQL statements rather than .save().


      The point is, I don't want to do literal SQL statements, I want Rails to do it automatically for me. I want to store IPs as integers in the database, but I want the model to expose them as strings.
      And in the future I may want to use stored procedures to create database entries.
    14. Re:Rails needs to be more mature by graznar · · Score: 1

      Ah, I was talking about your reference to a query like this: INSERT INTO foo VALUES(NOW());

      In that case, you CAN do it... http://wiki.rubyonrails.org/rails/pages/StoredProc edures

      BUT! That's not the Rails way. See this entry on DHH's blog.

      --
      [ check out my ruby book @ http://ww
    15. Re:Rails needs to be more mature by stallos · · Score: 1

      Hi, I am interested in the book but is it available as an ebook or hardcore cover? Where to buy it from? Ebay.com ? Thanks

  21. much better than the pick axe book by Anonymous Coward · · Score: 0

    I recently started reading this book, the style is indeed very engaging. It may not cover as much as the pick axe book, but at least it is not a pain in the ass to read.

  22. But that's the problem by TheSpoom · · Score: 1

    But see, that's a problem I've encountered recently; one of my team members for a project we're working on was all gung-ho about doing it in Rails, convinced that we could put things together as "one-liners" (his favourite word now, it seems). From the early stages, he was adamant that we do it in Rails, even though neither myself nor the third person in the group knew Ruby or Rails. So about halfway through the planning stages, I asked the guy what projects he had coded in Rails in the past.

    He'd watched the screencast and done the tutorial from a Rails book. That's it.

    Now, I'm not saying learning Rails (and Ruby) is a bad thing, don't get me wrong. But in early discussions of the project far before this point I'd made it clear that I had about six years of solid, real-world PHP experience and the third member had about a year.

    If the project were more open-ended, we may have ended up trying to do it in Rails. However, having a deadline, we ended up deciding to do the project in CakePHP, a bit of a compromise. So far, it's worked out really well for us, and we still get the benefit of coding in a MVC RAD framework.

    But yeah, I think lots of people buy into the hype of Rails too easily without thinking about it or trying anything different from the hand-held tutorials.

    --
    It's better to vote for what you want and not get it than to vote for what you don't want and get it.
    - E. Debs
  23. Then you should try PHP by mangu · · Score: 1
    I use PHP for the kind of work you mention, together with the Adodb library which is an abstraction layer for the database access. If you want to, you can also use the raw SQL statements in PHP, but that's rarely needed and I don't recommend it for portability reasons. As a framework for normal enterprise intranet web applications I use eGroupWare.


    With these tools, I have never found any need for Ruby, with or without Rails. I tried it and the first thing I noticed was ugliest quirk they stole from FORTRAN-77: the "end" statement. All the editors I use have a syntax enhancement mode that shows which brace pairs with the one where the cursor is. Why, oh why, throw away that very useful feature? What, exactly, did the Ruby creators think they would gain with that? This very small detail shows that the whole language isn't as well thought out as its fans claim, so I guess I got prejudiced against Ruby from the very beginning. When you code for a living, when the lines of code you wrote in your decades of work start to get into the millions, you will know how these apparently small details add up in the end. I need my language to work together with my editor, not fight against it.


    Ruby fans remind me of Lisp fans. Very vocal, always ready to present their arguments, concede no points, admit no failures. But one gets the impression that they are mostly academics, people who do not code for a living. If you have to solve a real life problem instead of a textbook example there are more practical languages to work with.


    Oh, sure, Ruby is very flexible, very adaptable, but in professional work one needs the efficiency of specialization. I use PHP for web access to databases, Perl for small scripts that handle text files, C++ with Qt for GUI work, Python for prototypes and C for deliverable number crunching applications. For professional work one needs professional tools, swiss army knives are for boy scouts.

    1. Re:Then you should try PHP by Anonymous Coward · · Score: 0

      You can use Ruby pretty much like PHP with erb (embedded ruby), and you can rewrite quite easily your text processing Perl files in Ruby, since one of its goals was to be a better Perl. (You can of course use QT with Ruby to create GUI.) Care to explain why the "specialisation" of PHP or Perl make them better or more professional at those tasks ? I see two reasons not to use Ruby: you need number-crunching speed and it's too difficult to put the computing part in a C extension used in Ruby, or you want compile-time type checking and such, because you don't prefer designing tests. However, saying that PHP is "more professional" than Ruby is a bold statement.

      (I also like Lisp or OCaml. I suppose there's no hope for me to be professional someday)

    2. Re:Then you should try PHP by Watts+Martin · · Score: 1

      Funny, but I've coded for a living off and on for over a decade, including in PHP, and don't consider the inclusion of an "end" statement instead of a closing brace to be a damning indictment of a language. You're essentially arguing that not using C-like syntax shows a language isn't very well thought out.

      Suppose you had an array of hashes -- in PHP, something akin to:

      $mood_list = array( array( "id" => 0, "mood" => "happy"), array("id" => 1, "mood" => "grumpy"), ...)

      You need to know what the highest 'id' value is within that array. In Ruby, you'd write:

      i = mood_list.max { |a,b| a['id'] <=> b['id'] }

      There are other languages you could do this as easily in, but PHP is not one of them. And there are many, many things you find in a language like Ruby or Python like that.

      Writing off a language as powerful as Ruby (or Python, or several others) with very useful features--mixins, blocks of code as parameters, iterators (PHP5's library implementation is comparatively anemic), closures--that have no equivalent in PHP because you can't see past that ol' icky end statement--or can't press a button in your editor to select the current block of code--says more about your biases than it does about faults in the programming language. It's great you're making a living coding, but with all due respect, that doesn't make you very well-informed about programming languages you clearly haven't taken the time to understand.

    3. Re:Then you should try PHP by mangu · · Score: 1
      There are other languages you could do this as easily in, but PHP is not one of them.


      One should use the best tool for each application. When all you need is to set up a way for people to access a database in a corporation intranet, then the best tool is PHP, because it is the quickest way to create an interface between SQL and HTML. You don't need closures or blocks of code as parameters for that. SQL has all what's needed to handle the database. But when I want to get data from a web form, all I need to do in PHP is to name the variables the same way as the HTML input fields, the user's inputs are transferred automagically. Let's see how Ruby handles that. Or Perl, for that matter. You *can* process web pages in any language, even Fortran will do, but PHP is the simplest way to write simple web applications.


      Writing off a language as powerful as Ruby (or Python, or several others) with very useful features--mixins, blocks of code as parameters, iterators (PHP5's library implementation is comparatively anemic), closures ...


      All this talk about how Ruby has this or that feature that other languages lack reminds me of other languages like APL, Forth, Prolog, Smalltalk, Haskell, etc. Yes, there are things that you can do in a much better way in each of those languages than in more "mainstream" languages like C. But, if they are so great, where are the big wonderful applications written in those languages?


      that doesn't make you very well-informed about programming languages you clearly haven't taken the time to understand.


      Actually, I *have* taken the time to understand Ruby. But I have never seen an example of something that a Ruby closure does that I cannot do in other languages. You can even do closures in C, with function pointers. The same goes for all the other features in Ruby, doing the same thing in C/C++ is just a matter of knowing the right construct and the right library.


      However, note that this is a different situation from the PHP handling of HTML forms that I mentioned above. Ruby may have a simpler way to do some operation, but this will not be of much use if I only have to do that operation infrequently.


      OTOH, one could also say that Ruby or Python advocates clearly haven't taken the time to understand C and C++. For instance, should strings be mutable, as in Ruby, or immutable, as in Python? Forget the endless philosophic discussion one finds in language forums, C++ allows the programmer to decide, by the use of "const". C++ is very, very complex and hard to learn in its entirety, but when you really learn it you can have the full power of any other language with the execution speed that only an optimizing compiler can get.


      In the end, the big advantage of a simpler language is for developing prototypes for new algorithms. For that, the key word is "simple". If you want to use the full power of the language, Ruby's syntax isn't so simple at all. And even if Ruby has a very simple way to do something, it may be simpler to implement it in Perl if it's already available in CPAN.

    4. Re:Then you should try PHP by Watts+Martin · · Score: 1

      In a Rails form, I might type

      <% form_for :user do |form| %> <%= form.text_field :name, :size => 40 %>

      And then access that returned variable with

      @user.name

      I suppose I'm not seeing the dramatic productivity loss in doing it that way compared to PHP's approach of

      if (!empty ($_POST)) extract($_POST);

      ...which isn't necessarily safe, anyway, from a good coding practice standpoint. (I tend to use the EXTR_PREFIX_ALL option for extract, which isn't necessary with Rails--the returned form variables exist as accessors in a class variable named after the form, so there's no possibility of a namespace collision.)

      At any rate, the argument "you can do anything in C++ if you have the proper libraries" is true, but it's not an argument about language design except in a very peripheral sense--it's an argument for ignoring language design. The sentence works just as well if we change C++ to Fortran, Perl, or for that matter, Ruby.

      I can't help but be reminded of Java enthusiasts who were dismissing the observation that Ruby on Rails often accomplishes the same thing as Java and various libraries in much fewer lines of code; "why," said the Java advocates, "lines of code is a silly measure, because we're using Eclipse and it's virtually typing all that extra library and framework setup in there for us!" This may well be the case, but it's hard not respond with, "Perhaps one of Ruby's virtues is that we can do as much as we can in it without all that extra library and framework setup."

      If you want to use the full power of the language, Ruby's syntax isn't so simple at all.

      That's an extremely subjective measure, isn't it? I find Ruby considerably cleaner and simpler than Perl, and I know I'm not alone.

  24. No, it came from a PHPtard. by Anonymous Coward · · Score: 0

    Rails was written by a PHPtard. That's why there is no seperation at all between controller and view, they just share all the same data. That's why everything is a function in the same namespace that_is_a_million_miles_long_for_no_reason().

    1. Re:No, it came from a PHPtard. by graznar · · Score: 1

      Er, no. They only share instance variables; you can still have separate local variables. How are you to get data into the view if you don't share it? Sheesh. And what method is a million miles long? has_and_belongs_to_many? Would you rather he name it something semantically meaningless like "h_a_btm" like PHP or Java would?

      --
      [ check out my ruby book @ http://ww
  25. sometimes configuration isn't a bad thing... by gravyface · · Score: 1

    My only problem with the "convention or configuration" mantra is the lack of transparency: unless you *know* that RoR does all this automagic pluralization and convention "guesswork" you're destined to bang your head off the corner of the desk trying to figure out how it works. I'm thinking in 2-3 years time and somebody needs to maintain a RoR app who might be familiar with language xyz and abc, but not Ruby. Good luck trying to step through the code and figuring out how it works without investing some serious time in understanding the language and framework intimately. No, I'm not advocating reems of XML config files ala J2EE frameworks, but I see nothing wrong with a simple conf file for most projects.

    --
    body massage!
    1. Re:sometimes configuration isn't a bad thing... by flipper65 · · Score: 1

      This is where we are going to have to agree to disagree. In the scenario you describe it would seem to me that convention and not configuration would be the big winner. If I can go into code knowing where everything should be then I am already several steps ahead of the game in maintaining or porting that code. You don't need to dive very deeply into rails to find out what the standard conventions are. This was a big reason that we chose to make this move.

      The problem with conf files is that they tend not to be simple.

  26. Good book but it's very wordy by destiney · · Score: 1


    I read this book last month. It is a _good_ book.

    My only complaint is that it is very wordy. I caught myself thinking several times "Yes, I get it.. can we move on now?"

  27. Re:Oh vey. by Breakfast+Pants · · Score: 1

    I can't wait for the day morons like you learn about ending sentences with some sort of valid punctuation.

    --

    --

    WHO ATE MY BREAKFAST PANTS?
  28. Amazon sucks by carlivar · · Score: 1

    Amazon really ticks me off lately. I think they just throw out the phrase "usually ships within 24 hours" everywhere, since no one can really define what "usually" means. I just ordered "Programming Ruby" on Sunday. It's now late Wednesday night and it STILL has not shipped. I don't mind the slow Super Saver Shipping but at least get ONE BOOK out the door within a couple days... sheesh. Yeah, I'm switching to bookpool or buy.com.

    --
    Vote Libertarian
    1. Re:Amazon sucks by rufo · · Score: 2, Informative

      Erm, the whole point of super saver shipping is that your book gets shipped after everyone who's paid for theirs. It's not so much the shipping time as it is the time it will take Amazon to ship the book. Either pay for the shipping or sign up for the Amazon Prime trial and your books will magically start shipping within 24 hours.

      --
      My English teacher once told me that two positives don't make a negative. Two words for her: Yeah, right.
  29. Do not introduce a new language by Anonymous Coward · · Score: 0

    if you use python in your shop already, then use a python-based web stack.

    if you use perl, use jifty

    once you introduce a new langauge, you will start having to code everything twice. its not worth it.

    1. Re:Do not introduce a new language by gregarican · · Score: 1

      You must be trolling. If everyone had that attitude we would still be coding in Fortran or Cobol FFS!

  30. PHP and Java can go to hell. Sweet, sweet hell. by Anonymous Coward · · Score: 0

    Frankly, PHP and Java are closer by that metric. Ruby is in the company of Smalltalk. Small-fucking-talk, motherfucker.

    The people I curse most, the people that I spend every waking hour condemning and conspiring to send to hell are the inventors of Java and PHP.

    Seriously, who does not believe these people are Satan's evil little helpers upon the Earth?

    Satanists, that's who! Satanists want nothing fucking to do with those guys. Not even fucking baby eating, pig blood drinking Satan-fucking-ists.

  31. Why? by Living+Ghost · · Score: 0, Offtopic

    I usually find RoR disabled on most web servers... What's the use?

  32. Nice review. by Anonymous Coward · · Score: 0

    For some odd reason I feel like I'm reading a 9th grade current events summary. Hope your coding skillz are better than your grammatical skillz there Simon...sigh...

  33. Keen critical insight by tehcyder · · Score: 1
    If Ruby on Rails is of no interest, then this book is most likely not the one you want
    Er, well, yes, I suppose not.
    --
    To have a right to do a thing is not at all the same as to be right in doing it
  34. OT: Type 3 by booch · · Score: 1

    OK, I couldn't find it in Wikipedia, and I've never heard the term. What is a type 3? I learn much better when I understand why. Does that make me a type 3 or a type 4 or something?

    --
    Software sucks. Open Source sucks less.
    1. Re:OT: Type 3 by Anonymous Coward · · Score: 0

      haha, that's slashdot for ya:

      responders will look in Wikipedia before even reading TFA

    2. Re:OT: Type 3 by andrewman327 · · Score: 1

      I have never done this before, but here goes: RTFA!

      --
      Information wants a fueled airplane waiting at the hangar and no one gets hurt.
    3. Re:OT: Type 3 by booch · · Score: 1

      OK, now I feel dumb. As well I should. I'll admit that I only skimmed the article, because I've actually read the book it is reviewing; so I didn't think I'd get all that much out of the review. I read your comment -- about the way you learn -- out of context, thinking that the "type 3" was about the way you learn, not the third group of people who might be interested in the book. I did search the article before posting, and couldn't find any mention of "type" or "3".

      Duh! Sorry!

      I also like the Anonymous Coward comment about searching Wikipedia before reading the article. I think it should have gotten a mod point or 2.

      --
      Software sucks. Open Source sucks less.
    4. Re:OT: Type 3 by andrewman327 · · Score: 1

      Don't worry about it, booch. Happens to the best of us. It also happens to me!

      --
      Information wants a fueled airplane waiting at the hangar and no one gets hurt.