buttercat1791 on Nostr: I think so? You might be thinking in PHP-specific terms I'm not familiar with. As an ...
I think so? You might be thinking in PHP-specific terms I'm not familiar with.
As an example, though, I recently wrote a class for my day job that had a public `value` prop and a private `_value` state. Changes to `value` updated `_value`, but not vice-versa, because the public one had a change listener and I needed a way to change it without triggering the listener.
However, were it not for that case, I would have just used a single class property `value` with no explicit getters or setters, because TypeScript defines get and set behavior by default on classes, without the need for developer code.
As an example, though, I recently wrote a class for my day job that had a public `value` prop and a private `_value` state. Changes to `value` updated `_value`, but not vice-versa, because the public one had a change listener and I needed a way to change it without triggering the listener.
However, were it not for that case, I would have just used a single class property `value` with no explicit getters or setters, because TypeScript defines get and set behavior by default on classes, without the need for developer code.