Shaun Walker on Nostr: having to refer to specific classes/interface (basically any “code”) is ...
having to refer to specific classes/interface (basically any “code”) is incredibly tight coupling imo.
I appreciate the DX angle, I would achieve the same kind of DX by instead having an enum/class with constants, which will hold an agnostic string reference (so still not Foo::class, but some alias), then both systems need to understand this alias, but they’re not coupled because they are both free to be implemented in any way.
Published at
2024-04-10 14:11:58Event JSON
{
"id": "d90b247763dd30777cf5f4cd7a28bf42c779d376b19b7574f9f5fc5e0a739c5f",
"pubkey": "4401e8bce58c30c3f3f261424af4398a574d16b332e9a79ad45c6266145069b1",
"created_at": 1712758318,
"kind": 1,
"tags": [
[
"e",
"cdbb45c64c735142fa63e4de2bc4d1f5125e74433d8860666a8d42c5b48d3d25",
"",
"root"
],
[
"p",
"1021c34f5340dbb740c0814437248fd3859b28145884ed2eeca94f93af3f88f7"
],
[
"proxy",
"https://phpc.social/users/theshaunwalker/statuses/112247329167049892",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://phpc.social/users/theshaunwalker/statuses/112247329167049892",
"pink.momostr"
]
],
"content": "having to refer to specific classes/interface (basically any “code”) is incredibly tight coupling imo. \n\nI appreciate the DX angle, I would achieve the same kind of DX by instead having an enum/class with constants, which will hold an agnostic string reference (so still not Foo::class, but some alias), then both systems need to understand this alias, but they’re not coupled because they are both free to be implemented in any way.",
"sig": "cd65d4291c850a56443c34a497b6986ec392437b6acac8395f5ab31ffd4a26fef05981f873a30297f9322a2abdec04900573479b2ea538de002c22f84795d8f3"
}