Sunday, June 22, 2014

Few thoughts about exception handling

Few research questions in mind, which I would work in future insha Allah.
  • Given a code context and other specification, how would you decide if a an exception should be handled or thrown?
  • Are checked exceptions bad for design and productivity? Given that it introduced by the designers with a noble purpose or robust coding, what is your position? What are the rationale behind your stand?
  • How many catch clauses should we use for a method given that too many clauses would increase exception handling codes? Is there any optimal suggestion? Please note that you can use upper level exceptions (e.g., catching SocketException instead of ConnectionException and BindException) to reduce catch clauses.
  • What is StackOverflow community thinking of checked vs unchecked exception?
  • What is SO thinking of Java exceptions and C# exceptions?
  • Can exception name be recommended based on association rules of API method name, given that certain API methods are associated statically?
  • How to effectively handle an exception in a multilayer abstraction?