Either

From APIDesign

(Difference between revisions)
Jump to: navigation, search
(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...)
Current revision (12:52, 9 January 2025) (edit) (undo)
(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...)
 

Current revision

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 ***scala.Either<ReasonOfFailure, ReturnValue>*** and I read somewhere an article favoring **Either** over 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 exceptions. Thus use checked exception to deliver *reason of failure* (that needs to be handled) and proper return value to deliver the real result.

Personal tools
buy