argv[-1] on Nostr: I would like to extend my gratitude to whoever decided to add sealed classes, ...
I would like to extend my gratitude to whoever decided to add sealed classes, records, and exhaustiveness-checked switch pattern matching to #Java.
This has enabled me to use the same data-bearing-sum-type pattern that #Rust enums provide.
This feature just saved me a bunch of grief and potential bugs in implementing a state machine in which the states are records with different fields. Common in Rust, but this was hard in Java until now.
Keep up the good work!
#programming
Published at
2026-10-18 02:23:42 UTCEvent JSON
{
"id": "13f45ebbcf57093ea7149dac735de250580bd6a61b9f8e1fb73eb033fef7505f",
"pubkey": "e97cafa82a7dd144bb2ec1089abea1190be419346e906bf69f0bc243f01586fc",
"created_at": 1792290222,
"kind": 1,
"tags": [
[
"t",
"java"
],
[
"t",
"rust"
],
[
"t",
"programming"
],
[
"proxy",
"https://mastodon.sdf.org/users/argv_minus_one/statuses/117459532008110150",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.ditto.pub"
]
],
"content": "I would like to extend my gratitude to whoever decided to add sealed classes, records, and exhaustiveness-checked switch pattern matching to #Java.\n\nThis has enabled me to use the same data-bearing-sum-type pattern that #Rust enums provide.\n\nThis feature just saved me a bunch of grief and potential bugs in implementing a state machine in which the states are records with different fields. Common in Rust, but this was hard in Java until now.\n\nKeep up the good work!\n\n#programming",
"sig": "3c5d0b8a89b2dd36594f42ab29a6a082d9278d0d62ad487cd640a0e7bb149ccfe1a269b1ec29e4a9f5ebca1f9d4a924320cbc53ceb54ba71e11e31b1eb548b7d"
}