Code That Says Exactly What It Means

Lance Bachmeier no at spam.net
Thu Oct 30 17:32:37 UTC 2025


On Thursday, 30 October 2025 at 11:30:47 UTC, Arafel wrote:
> On 10/30/25 11:20, Zealot wrote:
>> and you can simply do this for the exact same result:
>
> That is a slippery slope. Of course you can manage visibility 
> by convention: python does it, and is widely successful, 
> whether because or in spite of it.
>
> Now the question is that if you go this way... why do you then 
> need any visibility attributes at all? Because to me this seems 
> like the worst of both worlds: you have some attributes 
> enforced by the compiler, and some others enforced by 
> convention. Now that's cognitive load.
>
> Also please don't misunderstand me. While I would prefer and 
> use something like `scopeprivate`, I come from java. This means 
> that having one class per file* feels kind of good enough to 
> me, so I'm not going to make a fuss about it.
>
> *: Actually, you can have more than one class per file, just 
> one public one. But it feels really unidiomatic.

This jumps into Clojure territory.

Fogus: "Following that idea—some people are surprised by the fact 
that Clojure does not engage in data-hiding encapsulation on its 
types. Why did you decide to forgo data-hiding?"

Rich Hickey: "If people don’t have the sensibilities to desire to 
program to abstractions and to be wary of marrying implementation 
details, then they are never going to be good programmers."

https://harfangk.github.io/2017/12/08/rich-hickey-interview-from-codequarterly.html

I largely agree with that viewpoint, so I see this entire 
discussion as a waste, and proposals for private by default as a 
disaster.


More information about the Digitalmars-d mailing list