News for hackers. Stuff that matters.
Re:Verb-Noun vs. Noun-Verb by delusional on Wednesday October 16, 2019 @05:43PM (#21276179)
It's real great to know that I can get and set all the fields. Thanks previous programmer.
Re:Verb-Noun vs. Noun-Verb by AmpsterMan on Wednesday October 16, 2019 @09:10PM (#21277995)
This is one of those paradigms that I don't understand in Java. It's the most trivial of trivial encapsulations.
Re:Verb-Noun vs. Noun-Verb by Izkata on Friday October 18, 2019 @05:14PM (#21295143)
It is (was?) the primary way to maintain binary compatibility between versions of class files, where switching an attribute to a method (if logic such as verification needed to be added in a future version) would break that compatibility.
Re:Verb-Noun vs. Noun-Verb by mthoms on Thursday October 17, 2019 @11:24AM (#21283030)
Setters I get (see what I did there?). It's the superfluous getters that simply return the values I'll never understand.
Re:Verb-Noun vs. Noun-Verb by Izkata on Friday October 18, 2019 @05:18PM (#21295166)
See my cousin comment - it maintains compatibility when changes are internal to the class. For example, if a field was switched from concrete to derived, you'd have to switch the attribute to a getter, which would break compatibility with the previous version.