2 ms·
This is a correct reading of my remark. I happen to agree with the opinion of the followup as well, monkey-patching in production is a code stench. Still I pl
by inopinatus 10y ago
This is a correct reading of my remark. I happen to agree with the opinion of the followup as well, monkey-patching in production is a code stench.
Still I plead guilty to having occasionally monkey-patched prod code out of urgent necessity. My recommendation is to view it like an advanced and undesirable form of configuration; for my rails apps, each such hack always goes in an initializer file named for the library it is patching. If you are replacing third-party methods (or undermining the behaviour of a third-party method) and those methods are not called very frequently then judicious use of log noise e.g. through the deprecation mechanism will help at debug time.