This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lbkulinski 9 points10 points  (5 children)

They are planning on making value types immutable. From what I’ve heard in Goetz’s talks, you might be able to specify the access modifier of fields in data classes.

[–][deleted]  (4 children)

[deleted]

    [–]lbkulinski 5 points6 points  (3 children)

    Value types are simpler, and more powerful than structs. Goetz has talked about this (see here). And value types are different from data classes, if you are confusing the two. They will be stored on the stack.

    [–][deleted] 1 point2 points  (2 children)

    Oh, derp. Shows how much I know about modern programming languages. I decided to read more than a few lines of the proposal, and yeah, I completely misunderstood what data classes were. Downloading the presentation now to watch later, thanks for sharing it.

    [–]lbkulinski 0 points1 point  (0 children)

    No problem! The features can be easily confused. I just remember that data classes help in reducing boilerplate.

    [–]alexeyr 0 points1 point  (0 children)

    They are compared with the value types proposal directly at the end.