Sealed classes - would you want them in D?

Uknown sireeshkodali1 at gmail.com
Fri May 11 03:32:25 UTC 2018


On Friday, 11 May 2018 at 03:11:48 UTC, KingJoffrey wrote:
> On Thursday, 10 May 2018 at 21:26:12 UTC, Jonathan M Davis 
> wrote:
>> Idiomatic D tends to use classes rarely...
>
> What is the basis for this assertion?

D tends to prefer structs with UFCS member functions rather than 
classes, because one rarely needs the reference semantics or 
inheritance. Also, classes are pretty inconvenient because they 
are hard to use without the GC.

>
> On a separate issue, 'private' should mean private! (not 
> kinda-private).
>
> Let's not make D classes even more of joke.

`private` is for outside the module. Within the module, private 
is not applied because D wanted to avoid C++'s `friend` functions.


More information about the Digitalmars-d mailing list