in my opinion, data hiding in today's IT can be best utilized in a few specialized scenarios:
if working on a classified/sensitive project, tasks can be delegated to specific departments, and assembled by one specific person/department. this ensures a 'balance of power' and a system of checks and balances among the programming team. For example, each department may contribute code for a nuclear inertial guidance system, but only a select few will have absolute knowledge of the entire system. This allows for greater control of the project; if information is leaked, it is easy for the company to point the finger at select individuals.
Although this may be an extreme example, 'data hiding' has more applications of a proprietary nature in order to maintain company secrets, especially if portions of the project are outsourced or sub-contracted.
Clinton Portis
Practically a Posting Shark
833 posts since Oct 2005
Reputation Points: 237
Solved Threads: 118
If I have an object that carries out some clever mathematical calculations, and needs to maintain some internal variables to do so, it would be foolish of me to do anything with those variables other than hide them.
If they can be changed directly by a user/coder, then the next calculation could be completely wrong and the user/coder has no way of knowing.
If the user/coder can read them, they will be tempted to use them for something else, be it doing their own calculation or just reading them, and when I change how the code works so that the values/meaning of those variables changes, or I just straight up remove them, all their code will break and if they're unlucky they won't even know.
Even if I am the only user/coder, I know that I am not super-human. I forget things. I make mistakes. Sometimes I do things I know I shouldn't but mean to go back and fix later, and then never do. I need to hide data not only from other people, to protect them, but also from myself, to force myself to code responsibly and not screw myself over six months down the line.
Moschops
Practically a Master Poster
620 posts since Sep 2008
Reputation Points: 258
Solved Threads: 117
Moschops provides a good reason to hide data.. even if it is from yourself:
Even if I am the only user/coder, I know that I am not super-human. I forget things. I make mistakes. Sometimes I do things I know I shouldn't but mean to go back and fix later, and then never do. I need to hide data not only from other people, to protect them, but also from myself, to force myself to code responsibly and not screw myself over six months down the line.
Clinton Portis
Practically a Posting Shark
833 posts since Oct 2005
Reputation Points: 237
Solved Threads: 118