News for hackers. Stuff that matters.
Re:Java 18 / JDK 18: General Availability by sabageti on Tuesday March 22, 2022 @12:48PM (#30768420)
It isn't? You have a function red that doesn't throws anything you use a function blue that throws checked exceptions you handle the exception and it's all. The red functions doesn't become blue.
Re:Java 18 / JDK 18: General Availability by dfee on Tuesday March 22, 2022 @04:48PM (#30771330)
if the "red" function isn't successful, than you're mapping that error to what? a RuntimeException? great – you've now escaped the indirection with the original solution – just use RuntimeExceptions.

map it to another checked exception and you now have a "blue" function. and, you also have another layer of abstraction in your errors.

if you can't actually handle the error, skip the circus and just let the exception propagate to a general error boundary (alongside all those RuntimeExceptions you're unaware of).

It's a deep ocean, your defense mechanism of guarding against Checked Exceptions is a small fraction of all exceptions.

To be fair, I did really like the idea of checked functions when I first started using Java. But in practice, it's just too hard to tell what operations should be Checked / Unchecked (sometimes).