I&#x27;m of the somewhat unpopular opinion that &quot;getters for everything!&quot; is a philosophy that sounds good on paper, but results in writing a lot of getter and setter functions and feeling safe, while ignoring these sorts of traps cropping up everywhere.<p>Member variables are easy to reason about; they behave exactly like the type they are, and in the case of built in types, have extremely consistent behavior. Getters &#x2F; setters are a black box of mystery; I like to reserve that pattern for when there&#x27;s going to be extra work to retrieve some value, so my call site knows it needs to tip-toe around possible failures. While I can see the value in using getters&#x2F;setters for everything in something like an API or framework, I don&#x27;t see the value in trying to use them all the time, &quot;just in case.&quot;