4 ms·
This protects you from changes to the internal representation of state in the future. Direct field access totally blows away encapsulation.
by blacktriangle 5y ago
This protects you from changes to the internal representation of state in the future. Direct field access totally blows away encapsulation.
- grishka 5y agoSo, uh, do a usage search before changing stuff? You'll have to, anyway.
- kaba0 5y agoNot necessarily agree with private fields, but that is not an option for library writers.
- erik_seaberg 5y agoThat works if your class is never used outside your own organization, but the API of published code needs to be changed more gracefully using semver.