Sealed classes - would you want them in D?
Walter Bright
newshound2 at digitalmars.com
Sat May 12 13:38:18 UTC 2018
On 5/11/2018 8:02 PM, KingJoffrey wrote:
> On Saturday, 12 May 2018 at 00:39:29 UTC, Mike Parker wrote:
>>
>> Again, they're in the same module. From an encapsulation stand point, what
>> does it matter that private members are within or without any specific set of
>> curly braces? It only matters if you want to adhere to a purely conceptual
>> view of encapsulation. From a practical view, it matters not one whit.
>>
>>>
>
> It matters, in the same sense, that it matters if you have a module, full of
> functions (which are encapsulated units of code), but your module has a whole
> bunch of goto statements (not necessarily within a function). Now...you've
> essentially no idea now which functions are truly encapsulated, and which
> aren't.
Mike's right. D's encapsulation model is designed around the module. If a module
is too large to be comprehended, it should be broken up into smaller modules,
each with its encapsulated functionality.
More information about the Digitalmars-d
mailing list