|
![](/i/fill.gif) |
Darren New <dne### [at] san rr com> wrote:
> > You are nitpicking, and you know it.
> No, I really don't understand. You seem to be arguing that a universal
> naming convention isn't sufficient to say you have encapsulation, but a lack
> of ability to keep others from changing your private variables by accident
> is not a hindrance to encapsulation.
> You seem to be saying that it's "unmodular" to say you can only violate
> encapsulation on purpose via complex library routines intentionally designed
> for metaprogramming, but it's modular to let people violate encapsulation by
> accident?
Actually I'm not saying that. I have nowhere saying that.
I started by defending data hiding principle in the object-oriented/modular
programming paradigm, and stressed that this principle is completely
independent of the language used.
Then somehow you started talking about C++ in particular and somehow the
conversation was drifted from a programming paradigm in general to the quirks
in C++ in particular. I have nowhere defended C++ in particular, but data
hiding in general, as a programming technique.
Your argument against this technique seems to be "since you can't completely
guard against it in C++, it's as good as not having data hiding at all". As
if C++ had anything to do with this issue.
> > If you write normal, standard-conforming C++, you can perfectly well
> > enforce access rights.
> Um, no, really, you can't. How do you prevent me from corrupting your
> private variables with a wild pointer?
If you write standard-conforming C++, you won't have a wild pointer
(unless you have a bug, of course).
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |