On Mar 29, 2008, at 11:55 AM, Gregory Seidman wrote:
>
>> This approach does not embody the Rails value of beautiful code.
>
> That's an interesting response. I thought it fit in well with the  
> existing
> AR conditions hash syntax. Perhaps you have suggestions on how to  
> beautify
> it?

Look down at the next few lines, which you responded to even.  Those  
were in fact my suggestions.  I admit I have a bias against really  
complicated hash structures as a substitute for what I consider a good  
OO API, but it's not just me.  I asked a few other experienced Rails  
folks just now and no one thought your syntax was acceptable.

>> Take a look at ez-where, ar-extensions, and Ambition for better
>> approaches to doing more SQL in ActiveRecord via Ruby syntax.  Also,
>> DataMapper has a pretty lightweight syntax that adds methods to  
>> Symbol
>> for SQL operations (e.g. ":foo.not => nil".
>
> I have a good reason for trying to do it within AR. The ar- 
> extensions stuff
> looks promising for that, though its use of field name suffixes to  
> denote
> operators puts me off. Ambition, ez-where, and DataMapper all fail  
> for my
> purposes. I am implementation a reporting engine (the querying  
> backend,
> including some support for user-built queries) that uses and  
> understands AR
> associations. To manage that I need to be pretty tightly integrated  
> with
> AR, which is why I'm monkey patching. I'm going to look into ar- 
> extensions,
> but odds are good that I'll be sticking with my monkey patch.

I wasn't suggesting you use those pieces of code, but look to them as  
examples of better ways to express more complicated SQL queries in  
Ruby syntax.

>> This issue has been discussed literally for years.  If you want to
>> play in an open source project like Rails, it's best to do your
>> homework and check out the other approaches people are using before
>> jumping in with both feet.  That way your work is more likely to be
>> received as a useful contribution.  Not wanting to squelch your  
>> energy
>> and enthusiasm, just trying to offer some constructive criticism.
>
> Yeah, this is just unnecessary. If you read my post, it wasn't a  
> demand for
> functionality but an offer of code I had written for my own purposes.
> Saying that a policy decision has been made that providing broader  
> support
> for SQL comparators in AR conditions is out of scope is one thing.  
> Saying
> that I should do my homework because I offered some code you don't  
> happen
> to be interested in is another.

Offering some code doesn't mean that you get to bypass the usual  
process of people responding to your proposed contribution and  
evaluating it on its value and fit with the rest of Rails.  I do  
actually think the functionality you are proposing could be useful,  
but I dislike the syntax and think it's a poor fit with Rails style  
and values.  And I didn't say you needed to do your homework because I  
wasn't interested in your code; I said that because this topic has  
been addressed many times before, and there are existing solutions  
that kick your solution's ass.  But if you can't cope with people  
disagreeing with your opinion of the merits of your own code, you  
should get out of the open source game right away.

I hope you'll take my comments in the spirit they are intended.  All  
of us in this community make proposals that get shot down for various  
reasons, and not everyone disagrees with everyone else on everything.   
But when people take the time to respond to you and offer well- 
intentioned constructive criticism, it's usually good to at least be  
civil in response, no matter what you think of their comments.


--
Josh Susser
http://blog.hasmanythrough.com



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to