Artyom Bologov on Nostr: Types are useless… at least the way we use them. Most of the typed functions ...
Types are useless… at least the way we use them.
Most of the typed functions (thinking TypeScript here) deal with numbers and strings, and that’s not enough information to catch the actual mistakes. Anything can be a string! “email” type would make much more sense, but no one bothers to make/use it, and most type systems don’t really support it anyway. Mandating types is busywork, even with automatic type inference. One does not protect their code with it, they’re merely stating the obvious.
OOP and structural typing are something, but they still don’t allow selectively narrowing on values allowed and the fields restrained.
We need better types, if any.
Published at
2025-11-04 11:54:18 UTCEvent JSON
{
"id": "2ab269d29bf51dbdfdeb9d817d70e5b4a0b0e4ed409c774ba95dee5d35829d06",
"pubkey": "681d02ade973883f419f143e7c5b8a3f1f13dd585acd936353d8b39df86b1a9a",
"created_at": 1762257258,
"kind": 1,
"tags": [
[
"proxy",
"https://merveilles.town/@aartaka/115491291680259593",
"web"
],
[
"proxy",
"https://merveilles.town/users/aartaka/statuses/115491291680259593",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://merveilles.town/users/aartaka/statuses/115491291680259593",
"pink.momostr"
],
[
"-"
]
],
"content": "Types are useless… at least the way we use them. \n\nMost of the typed functions (thinking TypeScript here) deal with numbers and strings, and that’s not enough information to catch the actual mistakes. Anything can be a string! “email” type would make much more sense, but no one bothers to make/use it, and most type systems don’t really support it anyway. Mandating types is busywork, even with automatic type inference. One does not protect their code with it, they’re merely stating the obvious.\n\nOOP and structural typing are something, but they still don’t allow selectively narrowing on values allowed and the fields restrained.\n\nWe need better types, if any.",
"sig": "eb4a5afce7185ca89f37e556178181d4773e6fd389cebca43e2fc172ae16fa9540a8b07bc3c01ca5eb5eed051cf8921b2d2f34a48f75ada58adbfcc5eaf26434"
}