|
|
|
|
|
by ttfkam
408 days ago
|
|
I liked checked exceptions. I just think they were overused. Had a CS prof that summed up the optimal case like this: Programmer's fault: runtime exception Not programmer's fault: checked exception Reading from a file but the disk fails? Not programmer's fault. IOException (checked). Missed a null somewhere? Programmer's fault. NullPointerException (unchecked). |
|
Or, alternatively, the interface wouldn't declare it as thrown, and then you couldn't implement it in terms of disk I/O without rewrapping everything into unchecked exceptions. A good example of that is java.util.Map, if you try to implement it on top of a file-based value store.