4 ms·
The sad bit about checked exceptions is that everyone compares any sort of error tracking to them and immediately dismisses many useful ideas Java's checked ex
by spion 6y ago
The sad bit about checked exceptions is that everyone compares any sort of error tracking to them and immediately dismisses many useful ideas
Java's checked exceptions got the worst possible combination of error tracking. Its optional, so you don't even get to see if a function throws (kind of like the billion dollar null mistake) and its based on classes, which means a lot of irrelevant names leaking throughout the codebase.
Like with nulls, the main value is being able to claim that a function doesn't ever throw, at all. Apple's Swift got this just right.
A simpler system of "throws / doesn't throw" and with optionally polymorphic variants / unions to complement it would go much further.