lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Apr 16, 2014 at 12:15 PM, Hisham <h@hisham.hm> wrote:
> I know I'll be burned at the stake but here it goes:
>
> Monkey Patching is Never Really Needed. People do it just because they can,

... says the guy who demonstrated `"Hello, %s." % {"world"}`

Sooooo... monkey patching is what? Using libraries of the same name
but with different behavior? So I'm not monkey patching if I copy /
patch all of the methods from `math` into my own `mathx` library and
add whatever behavior I wish.

This is all just a cautionary warning to use unique names for your own
libraries, even when your intent is to extend behavior, not change
it... right?

I think that this is one of those lessons that I'm going to need to
learn through some late night of debugging caused by the subtle
problems created by bad behavior that I'm not currently capable of
capturing.

I like pretending that `math` knows how to deal with my real
fractions. When the day comes that it all blows up on my, global
search and replace will once again prove to be a powerful ally.

--Andrew