Martin,
I knew you'd get back to this...
This topic could almost be 'how do you like to code?', as there's lots of thoughts on it, much of it not Ruby specific.
Some things I've seen and done --
- Wrap everything in modules with names like MR1.0, etc
- Prefix all public functions and class defs with something like MR1.0
- Make all methods and 'getters/setters' in classes private if there is no reason for them to be called from outside the class. Same thing for functions and class defs in modules
- I don't use global objects. Many coders never use them. I use '@@' variables in the module that loads everything
- We're not, but pretend we're writing code for the government, and everyone wants to break/hack it...
I wrote a lot of my code with class variables, and at present on Windows that seems to be fine. For instance, the active model would be a class variable. It works now, but I don't know about mac's, and SU could change to allow multiple drawings in one instance, and hence, using class variables that way could break. When I get to it, I intend to rewrite my code. Put simply, at present, the Ruby environment is scoped to a single model. What if that changes?
HTH,
Greg