Friday, April 25, 2008

Statefulness considered harmful... again :-)

Serious programmers keep telling you ... again and again. Dynamic weenies keep not wanting to hear ... again and again.

http://kurt.karmalab.org/articles/2008/04/24/monkey-patching-core-classes-bad

"the first thing that happened was that 20 completely unrelated specs broke"


---


"This, in turn, snuck into our codebase in all sorts of little unexpected places."


Having the possibility to modify any behaviour of any object at runtime (monkey patching) is the silliest idea since trying to manufacture nitroglycerin in a rollercoaster. Whether it is a core class or not is irrelevant, it is still a stupid idea. Modifying a method in a class is the same as the nice Cobol feature ALTER PARAGRAPH TO PROCEED TO.

Thank you again for these few minutes of irrepressible laugh :-)

No comments: