Deliberate trespass in your own codebase isn't something you fix in software, it's something you fix by going over to someone's cube and removing their mouse balls until they get the point.
I knew there was a reason I prefer optical mice.
Anyhow, if you can't trust your fellow coders to not play symbol table / reflection / etc type games, you have problems!
Well, preventing deliberate tresspassing can be an issue - if you run code of untrusted people. Don't think that never happens - it happens all the time
. You don't want that processes can change their UIDs to anything they like, do you? ;-)
. Granted, Unix processes aren't very object like. Another example: MUDs runs code written by many untrusted contributors, sometimes hundreds or even thousands, who can subclass almost any object. A MUD would break down if there was no way to prevent deliberate tresspassing.
Furthermore, encapsulation can be broken with no access to variables, by virtue of having trivial getter/setter methods encapsulation IS broken, because the parameters of your object can be tweaked without asking the object nicely.
This I don't understand. How does that break encapsulation? The fact there are getter/setter methods means they are part of the API. Calling a setter method is
asking the object nicely (and it's up to the object to refuse).
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||