←back to thread

303 points FigurativeVoid | 1 comments | | HN request time: 0.203s | source
1. pugworthy ◴[] No.41851064[source]
When wondering if there was some dumb programming joke about "settiers" to go along with "getteirs" it dawned on me that there's a certain gettier nature to Get/Set encapsulation.

Suppose you've got a class library with no source, and the documentation defines a get method for some calculated value. But suppose that what the get method actually does is return an incorrectly calculated value. You're not getting the right calculated value, but you're getting a calculated value none the less. But then finally suppose that in the same code is the right calculated value in unreachable code or an undocumented method.

On the one hand, you have a justified true belief that "the getter returns a calculated value": (1) you believe the getter returns a value; (2) that belief didn't come from nowhere, but is justified by you getting values back that look exactly like calculated values; (3) and the class does, in fact, have code in it to return a correctly calculated value.