News for hackers. Stuff that matters.
Re:The Importance of Humility in Software Development (2020) by oftenwrong on Wednesday May 12, 2021 @11:51AM (#27131725)
>The worst for me is that it's impossible to catch exceptions in lambdas.

I don't take issue with your comment overall, but this is not true. You can catch exceptions within lambdas, and you can define functional interfaces that declare that they throw checked exceptions.

Re:The Importance of Humility in Software Development (2020) by ArnoVW on Wednesday May 12, 2021 @02:24PM (#27133502)
You're right. It's been a while and I forgot the exact issue. I looked it up on StackOverflow, to refresh my memory [1]. It is indeed possible to thow exceptions within a lambda.

My issue is that for something as everyday as "throwing exceptions", you have to define a separate interface, or catch it inside the lambda. The first option being the Evil Verbosity everyone is on about, the second essentially rendering the exception useless as an instrument.

[1] : https://stackoverflow.com/questions/18198176/java-8-lambda-f...