News for hackers. Stuff that matters.
Re:JEP draft: Exception handling in switch by kaba0 on Friday April 19, 2024 @04:04PM (#40091385)
> or put throws everywhere

Or put Result/Error etc. type everywhere. It’s literally analogous.

Re:JEP draft: Exception handling in switch by bedobi on Friday April 19, 2024 @04:20PM (#40091511)
it's literally not, I'm sorry but folks who think this (and it's extremely common) simply haven't familiarized themselves with the differences
Re:JEP draft: Exception handling in switch by kaba0 on Friday April 19, 2024 @04:35PM (#40091632)
Repeating the same stuff won’t make it true.
Re:JEP draft: Exception handling in switch by ackfoobar on Friday April 19, 2024 @04:53PM (#40091781)
Going off-topic, I've been on both sides of seeing the analogousness or not. I think there might be two modes of thinking for deciding whether two things are analogous.

Mathy people inspect the "shape" of, and interactions within the two things. Other people go for intuitive vibes. For more concrete stuff the two modes of thinking usually match up.

Summation and multiplication are literally different things, but a lesson in group theory tells you (ℝ, +) and (ℝ⁺, ×) are isomorphic.

Re:JEP draft: Exception handling in switch by kaba0 on Saturday April 20, 2024 @03:23AM (#40095508)
Something being analogous to something else means, that there is a bidirectional function/mapping between the two.

One can easily map any Result-typed expression to a checked exception one, and vice versa.