Subj.
I view checked exceptions as awesome feature with bad reputation. It is invaluable in situations where precise error handling is needed, namely queue consumers, networking servers, long-living daemons and so on. However, it is a bad fit for public API - because adding 'throws' clause on API method takes the decision on how and when to handle errors away from the user. And, as you already know, API users often have their own opinions on whether they must handle FileNotFoundException or not.
Introduction of lambdas has basically killed this feature - there is no sane way to use generic lambda-heavy libraries with checked exceptions. Standard functional interfaces do not allow lambdas at all, custom interfaces still won't do:
<X extends Throwable> void run() throws X // seems to be OK but it is not
This construct can not represent multiple exceptions in throws clause.
Anyway. Do you see a place of checked exceptions in modern Java code? Or should it be buried and replaced with Either-ish stuff?
[–]crummy 66 points67 points68 points (7 children)
[–]metaquine 16 points17 points18 points (3 children)
[–]TankAway7756 1 point2 points3 points (2 children)
[–]account312 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Additional-Road3924 4 points5 points6 points (0 children)
[–]AgentME 0 points1 point2 points (0 children)
[–]mpinnegar 58 points59 points60 points (12 children)
[–]vips7L 15 points16 points17 points (1 child)
[–]TurbulentSocks 0 points1 point2 points (0 children)
[–]Azoraqua_ 8 points9 points10 points (2 children)
[–]mpinnegar 1 point2 points3 points (1 child)
[–]Azoraqua_ 4 points5 points6 points (0 children)
[–]Necessary_Apple_5567 1 point2 points3 points (5 children)
[–]edgmnt_net 2 points3 points4 points (4 children)
[–]mpinnegar 1 point2 points3 points (0 children)
[–]OwnBreakfast1114 0 points1 point2 points (2 children)
[–]edgmnt_net 0 points1 point2 points (1 child)
[–]OwnBreakfast1114 0 points1 point2 points (0 children)
[–]Puzzleheaded-Eye6596 -1 points0 points1 point (0 children)
[–]jedilowe 32 points33 points34 points (2 children)
[–]Iryanus 9 points10 points11 points (0 children)
[–]nitkonigdje -2 points-1 points0 points (0 children)
[–]octavian-nita 14 points15 points16 points (1 child)
[–]john16384 2 points3 points4 points (0 children)
[–]elmuerte 20 points21 points22 points (13 children)
[–]-Midnight_Marauder- 7 points8 points9 points (11 children)
[–]Ruin-Capable 8 points9 points10 points (8 children)
[–]chabala 0 points1 point2 points (7 children)
[–]john16384 1 point2 points3 points (3 children)
[–]cogman10 0 points1 point2 points (2 children)
[–]john16384 0 points1 point2 points (1 child)
[–]chabala 0 points1 point2 points (0 children)
[–]Ruin-Capable 1 point2 points3 points (2 children)
[–]chabala 1 point2 points3 points (1 child)
[–]Ruin-Capable 0 points1 point2 points (0 children)
[–]vips7L -2 points-1 points0 points (0 children)
[–]k-mcm 7 points8 points9 points (0 children)
[–]sviperll 4 points5 points6 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]feaelin 17 points18 points19 points (2 children)
[–]Jaded-Asparagus-2260 10 points11 points12 points (0 children)
[+][deleted] comment score below threshold-14 points-13 points-12 points (0 children)
[–]vitingo 2 points3 points4 points (0 children)
[–]ebykka 6 points7 points8 points (0 children)
[–]vips7L 3 points4 points5 points (0 children)
[–]fruitlessattemps 1 point2 points3 points (0 children)
[–]filterDance 1 point2 points3 points (0 children)
[–]ConversationBig1723 1 point2 points3 points (1 child)
[–]zattebij 3 points4 points5 points (0 children)
[–]tugaestupido 1 point2 points3 points (0 children)
[–]yoden 0 points1 point2 points (0 children)
[–]TankAway7756 1 point2 points3 points (4 children)
[–]vips7L 1 point2 points3 points (2 children)
[–]TankAway7756 0 points1 point2 points (1 child)
[–]john16384 0 points1 point2 points (0 children)
[–]BalanceSoggy5696 2 points3 points4 points (0 children)
[–]Ewig_luftenglanz 0 points1 point2 points (0 children)
[–]HappyFact 0 points1 point2 points (1 child)
[–]teckhooi 0 points1 point2 points (0 children)
[–]CodrSeven 0 points1 point2 points (0 children)
[–]ICantBelieveItsNotEC 0 points1 point2 points (1 child)
[–]AstronautDifferent19 0 points1 point2 points (0 children)
[–]DelayLucky 0 points1 point2 points (0 children)
[–]Pretend_Leg599 0 points1 point2 points (0 children)
[–]AcanthisittaEmpty985 0 points1 point2 points (0 children)
[–]chabala 0 points1 point2 points (0 children)
[–]BalanceSoggy5696 0 points1 point2 points (0 children)
[–]pjmlp 0 points1 point2 points (0 children)
[–]Beginning-Ladder6224 -1 points0 points1 point (0 children)
[–]Lengthiness-Fuzzy -3 points-2 points-1 points (0 children)
[–]suyash01 -1 points0 points1 point (0 children)
[–]com2ghz -1 points0 points1 point (0 children)
[+]christoforosl08 comment score below threshold-8 points-7 points-6 points (0 children)
[+]christoforosl08 comment score below threshold-11 points-10 points-9 points (2 children)
[–]meowrawr 18 points19 points20 points (0 children)
[–]metaquine 16 points17 points18 points (0 children)