Nick Sabalausky wrote:
"bearophile" <bearophileh...@lycos.com> wrote in message news:gsai34$1p9...@digitalmars.com...
Nick Sabalausky:
There are people who swear by the ability of adding methods at runtime and changing the inheritance hierarchy dynamically. It makes for a very fluid
environment.
Personally, I've always seen that as extremely sloppy and haphazard.
Adding methods at runtime is named "monkey patching", and it is considered a bad practice even in Python.

Interesting, I didn't know that.

Usually in such languages such things are less dangerous because the code contains lot of tests anyway.

See, that just sounds to me like the dynamic-ness is just creating extra work for less payoff. I'd rather have my compiler automatically guarantee correctness (when possible) than have to manually create even more tests than I'm already creating and *hope* that they catch all the problems.

Assuming that you are testing the logic of your application, you will trivially check things like accessing "legnth" rather than "length" -- under the assumption that these two methods would do different things. You would spend approximately no additional testing effort on opDotExp.

This doesn't hold if you are not writing tests.

Reply via email to