private keyword dont appear to do anything

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Nov 3 21:18:53 UTC 2017


On Fri, Nov 03, 2017 at 09:08:56PM +0000, Nathan S. via Digitalmars-d-learn wrote:
> On Friday, 3 November 2017 at 20:01:27 UTC, Jonathan M Davis wrote:
> > Most folks are surprised by this behavior
> 
> I found it surprising at first but now any other way seems absurd to
> me.  None of the benefits of data encapsulation apply to code written
> five lines away in the same file.

This is a good point. :-)

Though in practice, source files do tend to get long... I've had to work
with source files over 8000+ lines long, and having encapsulation
between two distant parts of the file can be useful.  However, even
then, one can argue that any benefits of encapsulation you may have are
already negated by the very-not-encapsulated practice of an 8000-line
long source file, so the point is moot anyway.


T

-- 
Don't get stuck in a closet---wear yourself out.


More information about the Digitalmars-d-learn mailing list