Partial classes

Walter Bright newshound2 at digitalmars.com
Tue Jun 26 11:21:30 PDT 2012


On 6/26/2012 3:53 AM, Jacob Carlborg wrote:
> On 2012-06-26 01:43, Walter Bright wrote:
>
>> Monkey-patching has, in Ruby, been popular and powerful. It has also
>> turned out to be a disaster. It does not scale, and is not conducive to
>> more than one person/team working on the code base.
>
> I have only found it being very useful. I have never found it to be a disaster.
> Have you ever used Ruby?

Not much, but I've read accounts from people who have who say that 
monkey-patching doesn't scale.


> Ruby on Rails has to be the most popular Ruby library/framework

PHP is popular, too.


> and it adds a
> lot of new functionality to existing classes in the standard library.
>
> But just as with everything else you have to be responsible.

A language should not encourage bad behavior, nor should it make code 
unreasonably difficult to reason about.


> In Ruby you can
> replace arbitrary methods and classes, even in the standard library. In D you
> can overwrite an arbitrary piece of memory.

Not when using safe code, you can't.




More information about the Digitalmars-d mailing list