News for hackers. Stuff that matters.
Re:The Current State of Java Value Types by diebir on Thursday June 21, 2018 @04:15PM (#17368882)
My personal ask for the language designers is somewhat similar, but not quite this (it seems). I'd like to have either the language support for builders or setters where after creation an object becomes immutable.

The options we have right now are bad: the long constructor arguments are too verbose, the setters are causing non-immutability and builders are worst due to lack of discoverability and standards.

Re:The Current State of Java Value Types by jdmichal on Thursday June 21, 2018 @08:21PM (#17370272)
That sounds like a need for named and default constructor parameters. With the two of those, you can mix-and-match whatever values you want, with non-defaulted ones being required. And since the parameters are named, they self-document at the usage site.
Re:The Current State of Java Value Types by kjeetgill on Thursday June 21, 2018 @08:38PM (#17370357)
I know it's not quite what you're asking for but Java's annotations allow for pretty reasonable and compose-able preprocessors to implement things like this. Checkout lombok's @Builder annotation https://projectlombok.org/features/Builder