Is public by default an unsafe default?

M.M. matus at email.cz
Wed May 1 12:30:23 UTC 2024


On Wednesday, 1 May 2024 at 11:52:30 UTC, NotYouAgain wrote:
> ...
> Question 1 - is 'public by default' a sensible default for a 
> language that is aiming to be safe by default?
>

I am not sure how is "public by default" connected to "safe by 
default" (or "safe enough", to allow a more broader 
interpretation).

In principle, putting declarations of module B that are not meant 
to be public to module A into separate module C and importing 
that module C in module B will make everything from module C 
private in module A.

So, on a high level, generally speaking, I don't really see what 
the problem with "public by default" could be? You surely have a 
concrete, non-general piece of code in mind?



More information about the Digitalmars-d mailing list