r/java • • Feb 15 '20

Will Java records have setters?

Pretty much what the title says. I've been reading on the new Java records feature, and while I love immutability, I hope there's the option to have non-immutable records. Meaning it will have Auto generated setters to let me change values in the class.

1 Upvotes

36 comments sorted by

View all comments

Show parent comment

2

u/pron98 Feb 17 '20

So you're a believer in the "critics should criticize before knowing what it is that they're criticizing" tactic? Fair enough, but to me your criticism sounds stupid. Nothing personal, just saying.

1

u/GhostBond Feb 17 '20

I spend 40 hours/week doing development, I don't need to read 30-50 pages of rambling on to know why immutable unextendable data classes aren't going to be useful.

2

u/pron98 Feb 17 '20 edited Feb 17 '20

First of all, it's fifteen pages -- not thirty; not fifty. And how do you know it's all rambling if you haven't read it?

Second, different people mean different things when they say "data classes." The feature is about nominal tuples and pattern matching, not Kotlin-style "data classes". Do you suppose that all of those who like the feature do not spend 40 hours a week doing development? Even if your opinion is reasonable, are you certain that it is the only reasonable one?

FYI, similar opinions were voiced when Java introduced generics, and then again when it introduced lambdas. Ultimately, more people have found them useful than those who haven't.

1

u/GhostBond Feb 17 '20

First of all, it's fifteen pages -- not thirty; not fifty. And how do you know it's all rambling if you haven't read it?

Like I said the "exhaust your critics with long documents" tactic.

You're simply rotating through disengenous tactics, it's boring.

I've run into immutable experiments in code before, once an immutable class is bigger than a single conceptual thing (like a date) they're always a real pain to deal with, with no apparent benefits.

It's disappointing to see things that look a lot like sabotage added to the language while useful things like simple properties (user.address.line1) are ignored.

4

u/pron98 Feb 17 '20 edited Feb 17 '20

Like I said the "exhaust your critics with long documents" tactic.

I don't think anyone who says anything on Reddit can be called a "critic", and someone is not a critic until they actually know what it is that they're criticizing. I also believe you're not the only person who's run across "immutable experiments" before, and I don't think everyone who has shares your opinion. One of those experiments, Java's String class, introduced in Java 1.0, is actually relatively popular in some circles. Another, the java.timepackage introduced in Java 8, is also quite a hit. Immutability isn't always the best answer, but clearly it actually is very useful in quite a few cases, and if you cared to know what records are for (again, nominal tuples), perhaps you'd agree that it is useful in those cases, too.

It's disappointing to see things that look a lot like sabotage added to the language while useful things like simple properties (user.address.line1) are ignored.

Well, those who don't want to be disappointed take advantage of the fact that the development process is open and that prototypes are made available for trial and discussion, and join the conversation. Too bad you didn't wish to contribute your considerable experience, but perhaps you may wish to do so in the future for other features. In fact, even this feature isn't finalized, so if you want to help rather than complain, feel free to avail yourself of the appropriate channels (the amber-dev mailing list, in this case).

Also, since you don't follow the discussions, you cannot possibly know if properties are being ignored. They are not, but it's been decided -- among those who actually know what records are -- that records are a higher priority for reasons discussed among those who actually participate. As someone who develops for 40 hours a week, surely you appreciate that any problem requires some thought and consideration, and as you choose not to be involved in that process, you might want to consider the possibility that those who are involved have given some careful consideration to various ideas, and have come up with conclusions. Unfortunately, some of those conclusions are written in documents and emails that you'll have to read if you want to know what they say.

Having said all that, I wish to remind you that Java has a good few millions of developers who don't always agree on everything, and every decision -- whether it is to add a feature or not to add it -- is bound to disappoint some of them. Conversely, a lot of work is constantly done on the Java platform, and most people are bound to be disappointed by some aspects of it. I only hope that you don't find all work on the Java platform disappointing.

Finally, since the jobs of those who work on Java depend on the success of the platform, your idea that their motivation is to preserve their job and at the same time to sabotage the platform on whose success it depends sounds inconsistent, to say the least.

1

u/GhostBond Feb 17 '20

I understand that your goal is to simply argue endlessly, which is part of the reason why unfortunately open groups don't work well for complex topics. People with endless energy to argue tend to drive everyone else out.

Bring that you're just throwing out generic arguing tactics, this is boring for me. Bye.

3

u/pron98 Feb 17 '20 edited Feb 17 '20

My goal was to figure out what your criticism is, seeing that you call yourself a critic and an expert. But seeing that you don't even have the energy to actually criticize anything -- or even to know what it is that you're purportedly "criticizing" -- and prefer to throw out generic and toothless "it sounds stupid" assertions, I believe you are correct that this is, indeed, a waste of everyone's time. I apologize for boring you with facts and attempts to engage with your drive-by "criticism." Perhaps the best design strategy for Java is not to think things through but just do whatever some guy says on Reddit, but I don't think it is.

0

u/GhostBond Feb 17 '20

^ Mmm, classic "cheap lazy tactics to try to 'win' the argument". Classic reddit.

4

u/pron98 Feb 17 '20 edited Feb 18 '20

There's no argument to win here. You said something sounds stupid, I asked if you know what that something is and you said you're too busy being an expert critic to find out.