Embracing Immutability
Auto-generating setters can lead to increased mutability, making it difficult to reason about an object's behavior. By prioritizing immutability, as seen with Java's new record feature, developers can avoid common pitfalls and bugs associated with mutable state. The cultural shift towards embracing immutability challenges the default mindset of always having setters, encouraging a more thoughtful approach to object design.In this clip
From this podcast

Software Engineering Radio - the podcast for professional software developers
Episode 465: Kevlin Henney and Trisha Gee on 97 Things Every Java Programmer Should Know
Related Questions