Re:Go: What We Got Right, What We Got Wrong
by kaba0 on Friday January 05, 2024 @10:56AM
(#38880410)
That’s an absolutely bad take. Java is still very very conservative with every change, and they almost always have only local behaviors, so not knowing them still gives you complete understanding of a program.
Like, records are a very easy concept, fixing the similar feature in, say, c# where they are mutable. Sealed classes/interfaces are a natural extension over the already existing final logic. It just puts a middle option between none and all (other class) being able to inherit from a superclass.
Re:Go: What We Got Right, What We Got Wrong
by neonsunset on Friday January 05, 2024 @11:12AM
(#38880639)
C# records default to immutability. However, struct records being a lower level construct default to mutable (which can be changed with readonly keyword):
record User(string Name, DateOnly DoB); // immutable
record struct Cursor(int X, int Y); // mutable
readonly record struct Point(int X, int Y); // immutable
As a Java guy, I think this is looking like a desperate attempt to remain relevant while forgetting why the language succeeded in the first place.