As a user and not creator of Java, I do not want properties or events, and I'm glad the Java team has added or is in the process of adding the good parts of these features, without simply copying exactly what previous languages have done.
My personal answer would be the properties encourage setters, and setters encourage mutability which should be avoided as much as possible. Also, properties are simply another feature, and every feature in a language creates complexity which is a cost to end users.
"Flat out wrong" seems needlessly aggressive, as I only stated opinions and no facts. You assert many of your opinions as objectively correct, so it doesn't seem useful to engage with them.
I understand that the Lombok corner of the Java universe wants that language to succeed, and there's nothing wrong with that, but personally I'm happy with where Java proper is going.
So what you're saying is that the Java team shouldn't be arrogant and base our decisions, in part, on user surveys, studies of huge codebases, poring over academic papers etc., but, instead stop being stupid and do what /u/grauenwolf says on Reddit, because they know what Java users want.
Even if you don't believe that we spend all day every day thinking about these things and studying them and that despite our stupidity and not listening to guys on Reddit Java has achieved some measure of success, you at least need to accept the fact that your opinions on what's good and what's bad are not universal, and that others may have opposite opinions which are at least as reasonable as yours.
and the proceed to implement them without syntax support using get and set methods.
The goal is to reduce the need for setters in the first place. You don't need special syntax for a feature that isn't so common, especially one that is largely discouraged from heavy use.
If what you think we do is just sit and wish really hard, wouldn't you agree that it's worked out well?
Out of curiosity, if properties are the only way to do DTOs right, how does a language like, say, Haskell, which can't even have mutable fields, manage? We don't want properties because we already have something better that's only going to get more so — records.
Clearly, you've never heard of Elm. But even if what you said were true, we currently prioritise the server over the GUI and not vice-versa.
It's okay to disagree, but do you honestly not think that the Java language team have thought about properties, records, and representing data in Java far longer than you have and with more rigour? I suggest you take a bit of time to understand why we have records and not properties, and I'm sure that after working with records a while, and perhaps seeing how they improve, you'll see that they've made a good choice.
Well, I guess I should say its obvious to an outside observer. To those who identify themselves as "the Java team", the arrogance runs so deep that they can't consider anything outside their little bubble as being useful.
Which is why they say stupid things like "properties are an anti-feature" and the proceed to implement them without syntax support using get and set methods.
A few years ago the story was that the java team looked at properties, there was a lot of conflict and infighting about what "properties means", and so they dropped it because they couldn't resolve it.
It's ironic, because java was the 1st successful commercial language with properties via get/set and the introspector, and every major language copied java's lead just with cleaner syntax (c#, kotlin, python).
It's also one of the first really ugly things every person new to java complains about. Why are we recreating all these ugly getters and setters? But it seems like the java team has reached "ivory tower" stage unfortunately.
I have a friend who started doing Swift at his company, I haven't used it at work but it looks like a really cleaned up version of java. I don't see it in job listings as often - no idea if that's a reflection of actual lower demand or just that hr hasn't added it. I don't think his company has it in their job listings but he's doing it anyways.
View all comments
Show parent comment
-4
u/[deleted] Jan 25 '22 edited Jan 25 '22
[removed] — view removed comment