News for hackers. Stuff that matters.
Re:Java 1.0 Turns 25 by xxs on Saturday January 23, 2021 @10:45AM (#25883014)
getters/setters became popular with RMI. Public fields have all kind of security/code smell issues. Most classes should be immutable.
Re:Java 1.0 Turns 25 by JulianMorrison on Saturday January 23, 2021 @11:08AM (#25883243)
Public writeable fields are threading and encapsulation smells but public read-only fields just say, this data is part of my interface.
Re:Java 1.0 Turns 25 by xxs on Saturday January 23, 2021 @12:17PM (#25884120)
well, yes however fields cannot be part of an 'interface' in java. (they can but they'd be static)

I do use package private fields liberally, though. Just not non-static public fields.

Re:Java 1.0 Turns 25 by JulianMorrison on Sunday January 24, 2021 @06:55PM (#25897475)
Interface as used here means the broader concept of a "a class's interface is its public advertised operations" and not the specific Java thing called an interface.