New page: I am a great supporter of checked exceptions. Maybe not exactly as realized in Java, but I believe the concept (after few homey touches) deserve to be love! Scala offers ***sc...
New page
I am a great supporter of [[checked exception]]s. Maybe not exactly as realized in [[Java]], but I believe the concept (after few homey touches) deserve to be love!
[[Scala]] offers ***scala.Either<ReasonOfFailure, ReturnValue>*** and I read somewhere an article favoring **Either** over [[JDK|java/util|Optional]] exactly for the reason that _None_/empty misses the reason why it is empty. Some might say, use **Either** then!
However I believe that even better concept are [[checked exception]]s. Thus use [[checked exception]] to deliver *reason of failure* (that needs to be handled) and proper return value to deliver the real result.
[[Scala]] offers ***scala.Either<ReasonOfFailure, ReturnValue>*** and I read somewhere an article favoring **Either** over [[JDK|java/util|Optional]] exactly for the reason that _None_/empty misses the reason why it is empty. Some might say, use **Either** then!
However I believe that even better concept are [[checked exception]]s. Thus use [[checked exception]] to deliver *reason of failure* (that needs to be handled) and proper return value to deliver the real result.