News for hackers. Stuff that matters.
Re:JEP draft: Exception handling in switch by 9dev on Friday April 19, 2024 @02:07PM (#40090116)
Just because the languages en vogue right now use result tuples does not invalidate exception handling altogether, no matter how strongly you may prefer them. It’s tradeoffs all the way down.
Re:JEP draft: Exception handling in switch by bedobi on Friday April 19, 2024 @02:41PM (#40090528)
What a shallow critique. Object oriented error handling (which is what returning objects instead of exceptions is) isn’t used because it’s trendy, it’s used because it’s objectively (badumtish) better.
Re:JEP draft: Exception handling in switch by 9dev on Friday April 19, 2024 @02:47PM (#40090602)
You didn’t get the point, then. It isn’t objectively better, but some people argue it is. Having an opinion doesn’t necessarily mean it’s true.
Re:JEP draft: Exception handling in switch by bedobi on Friday April 19, 2024 @04:20PM (#40091517)
Kotlins compiler built in null safety is objectively better than Java's lack of the same

people disagree about that too, it's just that they're wrong

Re:JEP draft: Exception handling in switch by wiseowise on Friday April 19, 2024 @06:22PM (#40092573)
Kotlin’s null-safety is better and exceptions are better than Result types.
Re:JEP draft: Exception handling in switch by stoperaticless on Saturday April 20, 2024 @01:53AM (#40095157)
The fact that exceptions are used is testament that they do have some utility. Same can be said of either/result.

‘Objectively better’ is appropriate either in very simple choice scenario, or in a case where one is throwing away ones integrity.