Nothing pollutes java source more than getters and setters. I can't believe this still isn't being address. Wish they'd move in the direction Groovy has in this regard.
Java 9 features announced
51–60 of 228 posts
Re: Java 9 features announced
#52Nothing pollutes java source more than getters and setters. I can't believe this still isn't being address. Wish they'd move in the direction Groovy has in this regard.
Re: Java 9 features announced
#53Re: Java 9 features announced
#54Is it possible to have native JSON parsing with JNI bindings to make parsing faster, or will the overhead cancel out any boost in performance?
Re: Java 9 features announced
#55I also thought that type reification was being researched.
Does anyone know if either of these is still a thing?
Re: Java 9 features announced
#56Earlier quoted context omitted.
Amen. How about some language keywords like "readable" and "writeable"? public class Foo { public readable int canSeeeMeButCantChange; public writeable int cantReadMe; public int existingBehavior; } These are pretty simple changes to the compiler and verifier. You would make canSeeeMeButCantChange an invalid "left hand" variable in the compiler, and the verifier would have to check for any writes to the fields. cantR…
Is that not what final does? I'd be interested in seeing C#-like getters and setters. As long as they're just getting and setting, they're implied, but if you want to introduce a check or some other logic, you can do so without changing the signature of the class . Groovy does some of this, but it requires you to use the name of the field - ie. person.age will check for a getAge() method first, then fall back on the…
Re: Java 9 features announced
#57Nothing pollutes java source more than getters and setters. I can't believe this still isn't being address. Wish they'd move in the direction Groovy has in this regard.
And making your instance variables public doesn't solve that for you?
State changes can have desirable side effects.If you expose an instance variable directly it's harder to encapsulate that.
Of course there are exceptions. If you have a class that is meant to be only a parameter bag(in an rest API for instance),that's ok,imho.
Re: Java 9 features announced
#58I'm deeply missing hot swapping. I believed it could be included in java 9 but i think we have to wait...
Isn't this basically what Spring is for? I get that it's not included in the language itself, but that seems more like a feature that should be provided by a framework rather than the language itself...
Re: Java 9 features announced
#59I thought one of the things promised in Java 9 was to finally fix the primitive mess, including all of the boxing and pointer chasing. Yet I can't find that here. I also thought that type reification was being researched. Does anyone know if either of these is still a thing?
Re: Java 9 features announced
#60Still no solution for the GC fragmentation and pauses? Arbitrarily large heaps and data structures? They are going to improve lock performance, but do nothing to help people avoid locking like lightweight threads. Not waking up a thread and not locking is faster... It's weird how so many software projects completely lose sight of the fundamentals. I know I am biased due to how I use Java. I care very little for synta…