3 ms·
Don't allow private data structure to "leak" out of a module offers a great example in module, type, or even class design.
by jweir 14y ago
Don't allow private data structure to "leak" out of a module offers a great example in module, type, or even class design.
- adrianmsmith 14y agoI saw this, and was reminded that OO languages have language constructs to enforce this, i.e. the "private" keyword. If you want to make something private (e.g. your internal implementation) it's better to make it private (resulting in an error if someone accesses it) than to make it public, and write a rule in section 3.11 of a convention document and hope everyone using your code has read it and obeys it.
- qu4z-2 14y agoExcept that the rule there is equally applicable to OO languages, and is more about what you should and shouldn't expose in your interface.