2 ms·
If you’re just using your classes as data records, most languages have better options for you. Java has the record type. C# has struct and also property member
by addicted 5y ago
If you’re just using your classes as data records, most languages have better options for you.
Java has the record type. C# has struct and also property members that serve the same purpose.
I bet C++ and Rust also have better options for data records than plain classes.
- yakubin 5y agoUnfortunately, Rust doesn't. Rust only has "struct"-s, no classes, and they're private by default. Enums require the "pub" keyword once before a variant name, and once inside tuple associated with the variant. So often it's two "pub" keywords per line in an enum definition. So after writing code for a while, I then, upon compilation, need to fix up tens of "pub" occurrences. Pretty annoying. Wasted time, and the end result is hideous.