
June 14, 2011
12:52 a.m.
Steven D'Aprano wrote:
My apologies, I've been doing a lot of reading about the pros and cons (mostly cons *wink*) of monkey-patching in the Ruby world, the open/closed principle, and various forms of bugs caused by the use of globals.
I think part of the problem is that for the particular example you chose -- a "verbose" option to a command-line script -- you usually *do* want it to apply to the entire program, so using a global is perfectly adequate in that case. -- Greg