A side-by-side comparison of exception handling in Ada and Java

  • Authors:
  • Alfred Strohmeier;Stanislav Chachkov

  • Affiliations:
  • Swiss Federal Institute of Technology in Lausanne (EPFL), CH-1015 Lausanne EPFL, Switzerland;Swiss Federal Institute of Technology in Lausanne (EPFL), CH-1015 Lausanne EPFL, Switzerland

  • Venue:
  • ACM SIGAda Ada Letters - Exception handling for a 21st century programming language proceedings
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

The purpose of this paper is to compare the exception handling mechanisms of Ada and Java. In order to be intelligible and useful to both communities, we have tried not to get into specific technical intricacies of the languages, perhaps sometimes at the cost of precision. Nevertheless, we decided to use the language-specific terminology whenever we write about a given language. We believe that the contrary would often lead to misunderstandings: a) the same term sometimes covers two different concepts, e.g. object, or b) when the concepts are basically the same, the features provided by the language can be largely different, making any unification impossible, e.g. task in Ada and thread in Java.Table 1 "Comparison of Terminology" shows the meanings and correspondences of the most important terms related directly or indirectly to exception handling in the two languages.We did not try to assess the merits of the two languages, not even with regard to exception handling. The issues are too many, and would by far exceed the scope of this paper: How to assess trade-offs between expressive power and performance, if ever a definite evaluation of performance is possible? How to assess language constructs whose "good" intent cannot be enforced? E.g. in Java, the "lazy" programmer can declare Throwable in a method's throws clause, instead of referring to specific exception classes. Where is the borderline between responsibility left to the programmer, and an admittedly error-prone construct in the language?Our goal was therefore to present facts, and facts only, as much as this is possible without any interpretation.