Lurker News

Comments (277) 54 threads

Show all comments

Showing thread 16 of 54

axilmar3 replies#
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#
Rhis 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#
I feel the complete opposite. Ever since discovering this in Swift I wish more languages had the same documented separation
MauranKilom#
C++ 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.