4 ms·
Java's records are immutable.
by za3faran 3y ago
Java's records are immutable.
- kelnos 3y agoAnd most shops likely aren't using a JVM new enough to use records, and it will be a while before they are able to upgrade. And even then, most 3rd-party libraries out there won't use records, because they want to be compatible with the JVMs their users use. Hell, most popular libraries available on Maven Central are compiled with JDK8, or, at best, JDK11. Aside from immutable instances, it would be nice if 'final' was the default, as well.
- marginalia_nu 3y agoOn the one hand sure. But if we're going to critique Java honestly, can't we stick to the language the way it looks today and not the way it looked nearly ten years ago? Modern Java is quite pleasant to work with. One by one the papercuts and footguns have been fixed.
- wanttocomment 3y agoSo it sounds like the fix is available with an update. What more do you want?
- dtech 3y agoAlso still extremely hard to use due to basic they are, e.g. there is no "with"-er method or syntax yet to modify existing values.
- za3faran 3y agoWithers syntax is being evaluated/designed as far as I'm aware. You can still get some good work done with records in the meantime.