4 ms·
Sorry but I cannot stand the separation of structs/classes and 'classes' being 'by reference' and structs by value types. It's the reason I don't like D. C++ m
by axilmar 7y ago
Sorry but I cannot stand the separation of structs/classes and 'classes' being 'by reference' and structs by value types. It's the reason I don't like D.
C++ makes a lot more sense: the type declaration is not coupled to specific allocation patterns by default, which to me is a lot better choice than structs and classes ala D.
- gmueckl 7y agoRhis distinction also appears in C# in exactly the same way and I don't find it that hard to use. Also, Beef allows you to explicitly allocate objects on the stack via "scope:". So being by vale or by reference is a default rather than set in stone.
- rhodysurf 7y agoI feel the complete opposite. Ever since discovering this in Swift I wish more languages had the same documented separation
- MauranKilom 7y agoC++ is my bread and butter, but even I consider "struct and class are exactly the same except for default access specifiers" to be pointlessly redundant. I mean, the language could get rid of one of them, but I think the options offered here make sense.