|
|
|
|
|
by pifflesnort
4835 days ago
|
|
The checked exception concern leaves me scratching my head. Without checked exceptions, the forEach implementation has no way to gaurentee that the lamba won't throw, and has to be exception-safe at all times -- in the case of stateful code, this can generate a lot of boilerplate. Rather than write all that boilerplate, most people won't actually write exception-safe code across the board, which allows strange state-dependent failures to creep into the system. The unexpectedly-unwound-stack problems that Java's compiler is highlighting are still there, just hidden. Better, in my mind, to not use unchecked exceptions at all. |
|