Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Safer monkey-patching

by sundialsvc4 (Abbot)
on Jan 19, 2012 at 16:39 UTC ( #948815=note: print w/ replies, xml ) Need Help??


in reply to Safer monkey-patching

I quickly become nervous and neurotic when I become uncertain about “what will this code do?” and especially if I fear that it might do something different six months from now due to reasons that are beyond my control.

My general approach to dealing with the problem is to build a set of application-specific “helper” objects, which spell out exactly what functionality my application does actually require, and which by some means “reflect” the requests that are made to them to whatever bit of code is (presently...) tasked with carrying it out.

“Subclassing” and other fancy-pants ;-) methodologies (although of course I do routinely use them) make me nervous because they construct a system of mutual dependency that is just waiting on “the one exception to the rule” that will bring the Bill Ding™ (yes, the toys have a website...) come a’tumbling down.   “We just acquired who?”   “Marketing wants to do what?!?!”   :-O   Elegant software constructions can save a lot of time when they are written, but they are also mutually dependent upon one another, and those dependencies have a nasty way of becoming nasty.   I do not offer a generalized solution to the issue because I don’t think that one exists.   But “monkey patching” is specifically frightening to me because, even if it “solves” the problem now, I have no confidence that it will continue to solve the same problem forever.   I avoid the practice, and those similar to it, for these reasons.   You can only rely on Monster.Com to bail you out so many times before the word starts to get around.


Comment on Re: Safer monkey-patching

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://948815]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2014-12-22 09:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (113 votes), past polls