freedom patching

Bráulio Bhavamitra braulio at eita.org.br
Mon Oct 13 08:56:16 BRT 2014


On Sat, Sep 27, 2014 at 4:57 PM, Caio Tiago Oliveira
<caiotiago at colivre.coop.br> wrote:
> On 09/26/2014 03:35 PM, Bráulio Bhavamitra wrote:
>> for those getting afraid of monkey patching:
>> http://vimeo.com/17420638#t=27m27s
>
> I think you missed the point. He, DHH, loves monkey patching. His
> point is that he should be allowed to do his monkey patching, as he
> thinks he should be allowed to smoke pot or use cocaine.
>
> You are allowed to use monkey patch. But the same way you won't inject
> cocaine on other people body or put some pot on cakes you are going to
> share without the others consenting, you can't just throw monkey
> patching on code you share without the others consenting.
>
> You can use monkey patching or smoke pot, as long as you don't enforce
> me to monkey patch or smoke pot too.
> The freedom must be present on both sides.
Yeah, the both sides some people can't see while critizing monkey
patching, and then keep using monkey patch to solve many problems.
That is the contradiction.
>
>
> While I don't want to go too deep in why I dislike monkey patching, it
> is not the only way of giving coders freedom. Traits is another
> option: http://jsuereth.com/2010/07/13/monkey-patching-scala.html
> and some design patterns can be used in a case by case basis. Think of
> traits as a self documented monkey patching, which is discoverable and
> you can turn it off.
See refinements on ruby 2.0. Still freedom patching is well
estabilshed and keep going pretty well.

>
> DHH just mock on the design patterns uses and says "this is bad",
> while he didn't use any arguments of why we should favour monkey
> patching over traits.
Did he talk about traits? I don't remember that.

> With monkey patching you are adding a lot of effort for newcomers to
> find out what your code does, because it will require inspection on
> totally unrelated places. When monkey patching was much more popular
> in the Rails community, getting conflicts between gems usage was quite
> popular too.
Try object.method(:blah).source_location

> You could take two nicely working plugins, but they would require
> conflicting monkey patchings. Thus, this breakage from isolation would
> lead to the impossibility of having both of them working in the same
> environment without another serie of monkey patchings, to fix the
> conflicts caused by it.
Conflicting code cause is not restricted to monkey patch. With scoping
and prefixes, monkey patches conflict is a very distant reality. In
fact, I haven't seen one till now.

>
> With lots of monkey patchings you are just doing all of the system
> less friendly to new contributors.
>
> _______________________________________________
> Noosfero-dev mailing list
> Noosfero-dev at listas.softwarelivre.org
> http://listas.softwarelivre.org/cgi-bin/mailman/listinfo/noosfero-dev



-- 
"Lute pela sua ideologia. Seja um com sua ideologia. Viva pela sua
ideologia. Morra por sua ideologia" P.R. Sarkar

EITA - Educação, Informação e Tecnologias para Autogestão
http://cirandas.net/brauliobo
http://eita.org.br

"Paramapurusha é meu pai e Parama Prakriti é minha mãe. O universo é
meu lar e todos nós somos cidadãos deste cosmo. Este universo é a
imaginação da Mente Macrocósmica, e todas as entidades estão sendo
criadas, preservadas e destruídas nas fases de extroversão e
introversão do fluxo imaginativo cósmico. No âmbito pessoal, quando
uma pessoa imagina algo em sua mente, naquele momento, essa pessoa é a
única proprietária daquilo que ela imagina, e ninguém mais. Quando um
ser humano criado mentalmente caminha por um milharal também
imaginado, a pessoa imaginada não é a propriedade desse milharal, pois
ele pertence ao indivíduo que o está imaginando. Este universo foi
criado na imaginação de Brahma, a Entidade Suprema, por isso a
propriedade deste universo é de Brahma, e não dos microcosmos que
também foram criados pela imaginação de Brahma. Nenhuma propriedade
deste mundo, mutável ou imutável, pertence a um indivíduo em
particular; tudo é o patrimônio comum de todos."
Restante do texto em
http://cirandas.net/brauliobo/blog/a-problematica-de-hoje-em-dia


More information about the Noosfero-dev mailing list