From: James Adam Date: 2007-03-30T02:15:36+09:00 Subject: Re: On Enterprise Ruby On 3/28/07, Jason Roelofs wrote: > For the record, I do agree mostly with this blog post. In terms of quick > development, and mostly in testability, stored procedures are evil. It's also possible that the terming of things as "evil" doesn't help. While there are clear and valid arguments against their use, stored procedures aren't "evil" any more than any other string of characters is[1]. Clearly we prefer to use an object wrapper rather than writing actual SQL, but sometimes you *do* need to hand over a task to to system which is most suited to performing it, and often that is the database itself. You can certainly minimize the amount of raw SQL that you have to type in the common cases, but eventually we're all going to hit a task that takes hours via ActiveRecord, but only a few minutes in SQL, right? Stored procedures are just a way of making this logic available to other non-Ruby application (see: integration database; see: interoperability). That's all, really. It's fine to be opinionated, but if you're going to say (or at least imply) "Hey, relational people, yeah? I know you've got years of computer science and information theory behind you, but you know what? SQL BLOWS! What's that? You can prove that your query is optimal? Who cares! Wooo! Ruby! Wooo!" then people who DO need to deal with stored procedures, integration databases and other applications quickly going to start ignoring *everything* you say, including the valid and useful parts. Clearly I'm exaggerating. The point is that to you can't convince folks in "enterprisey" situations that they might see some benefit from using Ruby as part of their process if you've already alienated them; we can't go around declaring that everything we don't like is "evil", or "just wrong", and so on. A little bit of understanding goes a long way. [1] That said, as I chant the darke incantation "CREATE PROCEDURE "summoning" AS INSERT INTO my_house SELECT * FROM hell" why do I suddenly smell fire and brimstone? ;). -- * J * ~