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.
Published at
2024-09-14 12:52:26Event JSON
{
"id": "d2179368098e1e0287ed79775eab28501b8a6c80dccb91de0cbee126402ae3d0",
"pubkey": "70122128273bdc07af9be7725fa5c4bc0fc146866bec38d44360dc4bc6cc18b9",
"created_at": 1726318346,
"kind": 1,
"tags": [
[
"e",
"675510f1883799906d0b96200b0ff1c072bfb8d446b1a762fb2f910c8307c6c7",
"",
"root"
],
[
"e",
"113ace2492e041e568517a4230cb7613301f2c2f6d5fca9ac0c9d5c7ed57f428"
],
[
"e",
"dcca2a3ac6ef840106282f3be9f2348ee6261d15f3fe213bb8b59f885eba2e1d",
"",
"reply"
],
[
"p",
"70122128273bdc07af9be7725fa5c4bc0fc146866bec38d44360dc4bc6cc18b9"
],
[
"p",
"fd208ee8c8f283780a9552896e4823cc9dc6bfd442063889577106940fd927c1"
]
],
"content": "I think so? You might be thinking in PHP-specific terms I'm not familiar with.\n\nAs 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.\n\nHowever, 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.",
"sig": "f5788880ea4080a8e3045c3437f553d0163ba3f47f2a6bbb2e9f8a04606430fc4de7bfddd0bf9a6ffc1379c7d8fdb9568bcdbf1eb13d99c0872544c66dc03f56"
}