D 2015/2016 Vision?
Kagamin via Digitalmars-d
digitalmars-d at puremagic.com
Thu Oct 8 01:21:07 PDT 2015
On Tuesday, 6 October 2015 at 20:31:58 UTC, Jonathan M Davis
wrote:
> I don't think the problem is with structs. The problem is that
> programmers coming from other languages default to using
> classes. The default in D should always be a struct. You use a
> class because you actually need inheritance or because you want
> to ensure that a type is always a reference type and don't want
> to go to the trouble of writing a struct that way (and even
> then, you should probably just write the struct that way).
Hmm... If we must emulate reference semantics manually, it feels
like C++ with explicit references, pointers and all sorts of
smart pointers, and obviates need for classes being reference
types: just emulate reference semantics as we must do it anyway.
More information about the Digitalmars-d
mailing list