r/java • • Jan 16 '20

Records Come to Java

https://blogs.oracle.com/javamagazine/records-come-to-java
204 Upvotes

93 comments sorted by

View all comments

Show parent comments

31

u/[deleted] Jan 16 '20

[removed] — view removed comment

11

u/daniu Jan 16 '20

I'm also very happy with the way Java is updated, but I don't understand this particular decision.

Just follow your own bean naming standard, and those libs would work out of the box.

-8

u/BlueGoliath Jan 16 '20 edited Jan 16 '20

As /u/pron98 has said in the past, JDK developers don't feel consistency is all that important and it shows.

Project Panama's Memory Access API doesn't have "get" in front of its getters(despite boolean checks being prefixed with "is"), var is used in documentation despite providing no benefit and when old documentation doesn't, and now this. It's getting pretty ridiculous.

Blame the people who keep screeching that Java is too ceremonious and demanding things be made more "concise".

By Java 25 they are going to add optional semi colons.

8

u/lovett1991 Jan 16 '20

On one hand I kind of disagree about the 'get' keyword. I think moving away from it means the method signatures give a clear indication this is a domain object only. I started using immutables a while back and after a while it grew on me.

On the other I do agree about the 'is' keyword being added whilst 'get' isn't, it feels weird as a Java dev but I guess as an English speaker it isn't it if the realms of how you'd write something. For instance I would say 'his age is...' not 'his get age is' whereas I would say 'he is active' as opposed to 'he active'