Jim R. Wilson wrote:
- Stick
to calling a class's public methods, rather than accessing its $mFoobar members,
whenever possible
Meh. Getters and setters are clutter - just access what you want and
be done with it.
If only more languages used an Eiffel approach to this...
Keywords like 'private' and 'const'
just end up
making extension development more difficult.
Sounds like the result of bad design rather than a real problem. If
it's private, it should likely be something that Joe Averageprogrammer
will never need to access. If it's const, well, it should really be const.
- Don't depend on implementation
details of MW's methods, just the public interfaces
Well yeah, in an ideal world, yes. Unfortunately, it's sometimes
necessary to clone swaths of the codebase to make a small functional
change hidden where a wgHook doesn't reach. Use your judgement.
Sounds like procedural rather than OO thinking. But that gets back to
the original design problem.
Unfortunately, resolving problems through design rather than through
code (via kludge) is problematic in a distributed development model like
open source code with no dictator setting real standards. Closed source
environments can avoid this by appointing the dictator and giving it
power. Corporate environments fail because the dictator is, more often
than not, a moron.
My decades of experience in developing real-world, mission critical apps
(the kind that keep aircraft in the air) is that the closer to the
theoretically "perfect" design/code you get, the fewer problems down the
line. When someone opens a forbidden door, all hell eventually breaks
loose.
Mike