On Wed, Jun 20, 2012 at 3:51 AM, Henry Maddocks <[email protected]> wrote:
>
> On 20/06/2012, at 12:23 PM, Avdi Grimm wrote:
>
>> Please do not monkey patch core libraries in gems, unless the *purpose* of 
>> your library is to add functionality to core, eg a library of extensions 
>> like activesupport. Yes, this goes for additions as well as overrides. I 
>> cannot tell you how many times I've seen a "harmless addition" mess things 
>> up in confusing and hard to debug ways.

Right, one should be very careful when messing with core classes.

> <rant>
> While I understand it, I really disagree with this sentiment. Sure monkey 
> patching can cause problems, but so can a lot of things. With great power 
> comes great responsibility.
> I really don't like this prevailing view that we should dumb down the 
> language to the level of the least skilled developers. Banning unless/else 
> and 'and/or', predicates returning true/false, inheritance is bad, etc. This 
> is the wrong approach.
> Instead we should be raising the skills of the developers to enable them to 
> use the language to it's fullest.
> </rant>
>
> I think the OP's question has shown the right approach. He understands the 
> dangers so, in an effort to improve his skills, he has asked the question, 
> how can he use this technique in a way that will cause the least amount of 
> problems. We should be encouraging this.

I disagree: since OP only asked our support for applying a specific
technique but did not disclose any details about what functionality he
wants to add and why we cannot even judge whether the approach was a
good or bad fit for the problem he is trying to solve.  Could be that
a simple method which receives a String argument was sufficient etc.

Ian, please disclose a bit more detail about what problem you are
trying to solve.

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to