Linked by David Adams on Wed 14th Dec 2011 16:01 UTC, submitted by fran
Permalink for comment 500222
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
Features
Linked by Thom Holwerda on 05/24/13 17:26 UTC
Linked by Thom Holwerda on 05/21/13 21:38 UTC
Linked by Thom Holwerda on 05/20/13 11:29 UTC
Linked by Thom Holwerda on 05/18/13 21:33 UTC
Linked by David Adams on 05/16/13 4:23 UTC
Linked by Thom Holwerda on 05/11/13 21:41 UTC
Linked by Thom Holwerda on 05/08/13 14:22 UTC
Linked by Thom Holwerda on 05/02/13 15:28 UTC
Linked by Thom Holwerda on 04/29/13 21:06 UTC
Linked by Thom Holwerda on 04/24/13 22:24 UTC
More Features »
Sponsored Links



Member since:
2011-01-28
lucas_maximus,
"If you don't want to handle the exception locally you just add throws Exception after the method declaration. and catch the exception in the calling method."
This is exactly the wrong way to handle it IMO. If every function needs to add "throws Exception", then there's absolutely no benefit at all. By casting to the base exception class, we actually loose the information about the specificity typed exceptions which are thrown and we force calling functions to handle generic exceptions instead of specific ones.
I understand that checked exceptions are a highly opinionated topic, and I have no problem with devs who like them. My point was that forced exception handling in Java is awkward for rapid prototype workflows where it makes far more sense to focus on normal code paths first, and then add exceptional cases at later stages of development as needed.