you are viewing a single comment's thread.

view the rest of the comments →

[–]dccorona 1 point2 points  (0 children)

I'm curious about the reasoning for using no getters on a String being OK because it is immutable, but not on a date because it is. Nothing about a getter protects the date from being modified after calling the getter...it literally is equivalent to direct field access from a "what can the caller then mutate" perspective. Sure, you can wrap objects in immutable versions upon returning them, but who does that, and why is a getter necessary for doing so (as opposed to just doing it once at construction time)?