So... record field accessors don't follow the getX() standard that many ubiquitous libraries and tools rely on (Spring and Jackson come to mind)? Nobody started using Java 11 until it was supported by those, I can't see the use of records being any different.
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.
Did I say that? I don't think so, although I agree that there are things more important than consistency. Anyway, the new record method names are fully consistent with the naming standard for record methods and not consistent with things that are not record method names, and I'm not exactly sure what other thing they should be consistent with and why, especially as the feature's JEP states:
It is not a goal to declare "war on boilerplate"; in particular, it is not a goal to address the problems of mutable classes using the JavaBean naming conventions.
I believe it was in regards to the topic of var and/or API documentation months ago.
Regardless, you're saying it again:
Anyway, the new record method names are fully consistent with the naming standard for record methods and not consistent with things that are not record method names.
Records don't exist in a vaccum. To argue this is disingenuous and I'd hope as a JDK developer you'd realize that.
BTW, it's OK to be frustrated that other people have different opinions from yours -- most of us are frustrated by that -- but constantly blaming that on some flaw on their part is counterproductive. Even if your opinion is reasonable, the opposite opinion can be at least as reasonable.
Was anything said really an opinion?
Getter methods in previous Java APIs were commonly prefixed with "get" and many APIs rely on that.
There are methods that still have the "is" prefix for boolean checks.
var is now used in documentation without providing any value or makes the documentation muddy. There was a highly upvoted comment to my article thread like half a year ago agreeing that this is a thing.
Many newer language "features" have had "concise"ness as a motivation for their introduction into the language. Often times the JEP pages cite people complaining that Java isn't concise and is ceremonious.
So i'd like to know what part of any of that(at the core) is subjective/opinionated.
Not sure where you've been but "is" is common for Boolean and part of the old Javabean spec.
That's the point. They are keeping boolean check methods prefixed with "is" despite removing prefixes from all other methods in order to make it more "concise". The end result is an inconsistent mess both when compared to older Java APIs and even from within its own API.
19
u/daniu Jan 16 '20
So... record field accessors don't follow the
getX()standard that many ubiquitous libraries and tools rely on (Spring and Jackson come to mind)? Nobody started using Java 11 until it was supported by those, I can't see the use of records being any different.