News for hackers. Stuff that matters.
Re:A small guide for naming stuff in front-end code by unwind on Thursday January 13, 2022 @03:34AM (#29918200)
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.

Re:A small guide for naming stuff in front-end code by not2b on Thursday January 13, 2022 @05:02PM (#29927532)
The 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).