4 ms·
That's a separate statement, and they are not contradictory. Using Ruby's dirty tricks on shipped code -> hard for debugging/understanding. Using Ruby's dirty
by epidemian 10y ago
That's a separate statement, and they are not contradictory.
Using Ruby's dirty tricks on shipped code -> hard for debugging/understanding.
Using Ruby's dirty tricks while debugging -> boon.
The grandparent didn't claim the former to be false, only the later to be true.
- inopinatus 10y agoThis 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.