in reply to Re^4: defining methods on the fly
in thread defining methods on the fly

If you had someone redefine a function on you in the middle of debuging then be mad at that person, not at anyone who rights 'cool','clever', 'flexible' code.

You did notice that this is exactly what the Original Poster's self-proclaimed "cool" code does, right?

The point of his code is to let you add, define, and redefine attributes and methods at run time; this lets him completely alter the entire meaning of a entire class at any point in the program you he so desires.

In short, he's destroyed the regular expectation about how classes and objects will behave. He's said doing this just because it's "cool" to do so. He outright admitted that he felt that he was using bad programming practices, but somehow felt that being "cool" justified bad programming.

Do you wonder that I complained about this attitude? I think I am getting mad at the right person; the person who is about to redefine the codebase under me again, and the person who is teaching others to go do the same, without tempering "cool tricks" with the need to ensure that they're used carefully and correctly, and only when necessary.

Replies are listed 'Best First'.
Re^6: defining methods on the fly
by adrianh (Chancellor) on Aug 04, 2006 at 08:25 UTC
    The point of his code is to let you add, define, and redefine attributes and methods at run time; this lets him completely alter the entire meaning of a entire class at any point in the program you he so desires.
    The point of his code is to let you add, define, and redefine attributes and methods at run time; this lets him completely alter the entire meaning of a entire class at any point in the program you he so desires.

    So any use of runtime redefinition is bad? Even when it lets you abstract duplicate code, do like better testing, etc.?

    Throwing away a useful programming tool because some people misuse it is like throwing away electric drills because some idiot uses it to mix their smoothie and manages to put a hole in their hand.

      Throwing away a useful programming tool because some people misuse it is like throwing away electric drills because some idiot uses it to mix their smoothie and manages to put a hole in their hand.

      If someone says "I know this is bad carpentry practice, but I'm using my electric drill to mix smoothies", I cringe inwardly, and I don't hold out much hope for the state of their hands. ;-)