Random thought: Alternative stuct

kinke noone at nowhere.com
Wed Sep 5 19:21:51 UTC 2018


On Tuesday, 4 September 2018 at 04:03:19 UTC, Mike Franklin wrote:
> In my opinion, we shouldn't add a third option.

Agreed.

> Rather, we should deprecate classes, and make and expand the 
> capabilities of structs.  Languages like Zig and Rust have done 
> away with classes and all runtime overhead that accompanies 
> them, and are showing great promise by expanding on structs 
> with much more composable features.

I'm not familiar with the mentioned languages, but I definitely 
wouldn't want to miss classes for good old polymorphism. I'm not 
too fond of the implicit monitor field, but otherwise I find the 
struct/class distinction in D more or less perfect.


More information about the Digitalmars-d mailing list