Sealed classes - would you want them in D?

KingJoffrey KingJoffrey at KingJoffrey.com
Tue May 15 02:32:05 UTC 2018


On Tuesday, 15 May 2018 at 02:00:17 UTC, 12345swordy wrote:
> On Tuesday, 15 May 2018 at 00:28:42 UTC, KingJoffrey wrote:
>> On Monday, 14 May 2018 at 19:40:18 UTC, 12345swordy wrote:
>>>
>>> A slippery slope fallacy isn't helping your case. Write a DIP 
>>> if it bothers you so much, as it changes the languages 
>>> fundamentally.
>>>
>>>
>>> Alexander
>>
>> If 'getting a module to respect the enscapsulation boundaries 
>> the programmer puts in place would change the language so 
>> 'fundamentally', then the language 'already' presents big 
>> problems for large complex application development.
>>
> Evidence for this claim please.

- Object independence
- Do not violate encapsulation
- Respect the interface

All large software projects are done in (or moving toward) 
languages that respect these idioms.

Those that don't, are the ones we typically have problems with.

Isn't that evidence enough?

D modules provide uncontrolled violation of encapsulation (i.e 
can bypass the interface), and completely undermine these 
established idioms.

D modules, will let anyone (within that module) access your 
wallet and take whatever they want.

http://www.ccs.neu.edu/research/demeter/demeter-method/LawOfDemeter/paper-boy/demeter.pdf

>
>> But C++/Java/C# users all expect private to mean private,
>
> We expect that users C++/Java/C# to know that D is not 
> C++/Java/C# and to read the specification.
>
> Again write a DIP if this bothers you. You are not going to 
> make any language changes by ranting about it on the forums.

yeah.. I get it.. don't discuss anything, don't explore ideas or 
why others might think differently, just go off and write a DIP. 
That's why DIP's are so often poorly written and not worth the 
time of those that have to look at them.

I think such talk is just a way to shut down the converation, to 
be honest.

Based on this discussion so far, what I've gauged, is that 
spending the effort to write a dip, would be pointless (at least 
at this stage).

If D ever takes off (and I'm not sure it will, precisely because 
of the way it disregards those idioms I mentioned), then more 
pressure will come on D to change - and perhaps then sufficient 
support for a DIP would be there. But I honestly don't see how it 
can take off, unless if first respects those idioms.



More information about the Digitalmars-d mailing list