3 ms·
If the property/field is also writable, that would break symmetry with temperature() vs setTemperature()? How do you deal with that? Some people feel that symm
by unwind 5y ago
If the property/field is also writable, that would break symmetry with temperature() vs setTemperature()? How do you deal with that?
Some people feel that symmetry in names is important when achievable, since it makes them more predictable and the entire API more easy to figure out.
- PostThisTooFast 5y ago
- not2b 5y agoThe situation is symmetric if there's just a getter and a setter for a state variable, but perhaps sometimes temperature() does a measurement and there's no way to set it because it isn't a controllable quantity (for a thermostat I can set my desired temperature but it will take time for the room to warm or cool to that temperature).