Content deleted Content added
move Kiniry to a section, he is controversial (various IPs have modified the list to say the opposite of what Kiniry states) |
Citation bot (talk | contribs) Add: date, s2cid. | Use this bot. Report bugs. | Suggested by Abductive | Category:Software anomalies | #UCB_Category 5/35 |
||
Line 18:
| chapter-url = https://archive.org/details/effectivejava00bloc_0/page/241
| edition = Second
}}</ref> but Kiniry observes that Java's built-in {{java|FileNotFoundException}} is not at all an exceptional event.<ref name="Kiniry">{{Cite book | doi = 10.1007/11818502_16| chapter = Exceptions in Java and Eiffel: Two Extremes in Exception Design and Application| title = Advanced Topics in Exception Handling Techniques| volume = 4119| pages = 288–300| series = Lecture Notes in Computer Science| year = 2006| last1 = Kiniry | first1 = J. R. | isbn = 978-3-540-37443-5| s2cid = 33283674|url=http://staffwww.dcs.shef.ac.uk/people/A.Simons/remodel/papers/ExceptionsInEiffelAndJava.pdf}}</ref> Similarly, Bjarne Stroustrup, author of C++, states that C++ exceptions should only be used for error handling, as this is what they were designed for,<ref>{{cite web|url=http://www.stroustrup.com/bs_faq2.html#exceptions-what-not|title=Stroustrup: C++ Style and Technique FAQ|website=www.stroustrup.com|access-date=5 May 2018|url-status=live|archive-url=https://web.archive.org/web/20180202012417/http://www.stroustrup.com/bs_faq2.html#exceptions-what-not|archive-date=2 February 2018}}</ref> but Kiniry observes that many modern languages such as Ada, C++,
Modula-3, ML and OCaml, Python, and Ruby use exceptions for flow control. Some languages such as Eiffel, C#, Common Lisp, and Modula-2 have made a concerted effort to restrict their usage of exceptions, although this is done on a social rather than technical level.<ref name="Kiniry">{{Cite book | doi = 10.1007/11818502_16| chapter = Exceptions in Java and Eiffel: Two Extremes in Exception Design and Application| title = Advanced Topics in Exception Handling Techniques| volume = 4119| pages = 288–300| series = Lecture Notes in Computer Science| year = 2006| last1 = Kiniry | first1 = J. R. | isbn = 978-3-540-37443-5| s2cid = 33283674|url=http://staffwww.dcs.shef.ac.uk/people/A.Simons/remodel/papers/ExceptionsInEiffelAndJava.pdf}}</ref>
== History ==
Line 142:
== Uncaught exceptions ==
Contemporary applications face many design challenges when considering exception handling strategies. Particularly in modern enterprise level applications, exceptions must often cross process boundaries and machine boundaries. Part of designing a solid exception handling strategy is recognizing when a process has failed to the point where it cannot be economically handled by the software portion of the process.<ref>All Exceptions Are Handled, Jim Wilcox, {{cite web |url=https://www.granitestateusersgroups.net/2008/02/21/all-exceptions-are-handled/ |title=All Exceptions Are Handled |date=22 February 2008 }}</ref>
If an exception is thrown and not caught (operationally, an exception is thrown when there is no applicable handler specified), the uncaught exception is handled by the runtime; the routine that does this is called the '''{{visible anchor|uncaught exception handler}}'''.<ref name="cocoa">''Mac Developer Library'', "[https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Exceptions/Concepts/UncaughtExceptions.html Uncaught Exceptions] {{webarchive|url=https://web.archive.org/web/20160304111516/https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Exceptions/Concepts/UncaughtExceptions.html |date=2016-03-04 }}"</ref><ref>''MSDN'', [https://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception(v=vs.110).aspx AppDomain.UnhandledException Event] {{webarchive|url=https://web.archive.org/web/20160304131615/https://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception(v=vs.110).aspx |date=2016-03-04 }}</ref> The most common default behavior is to terminate the program and print an error message to the console, usually including debug information such as a string representation of the exception and the [[stack trace]].<ref name="cocoa"/><ref>''The Python Tutorial'', "[https://docs.python.org/2/tutorial/errors.html 8. Errors and Exceptions] {{webarchive|url=https://web.archive.org/web/20150901043830/https://docs.python.org/2/tutorial/errors.html |date=2015-09-01 }}"</ref><ref>{{cite web|url=http://www.javapractices.com/topic/TopicAction.do?Id=229|title=Java Practices -> Provide an uncaught exception handler|website=www.javapractices.com|access-date=5 May 2018|url-status=live|archive-url=https://web.archive.org/web/20160909002524/http://www.javapractices.com/topic/TopicAction.do?Id=229|archive-date=9 September 2016}}</ref> This is often avoided by having a top-level (application-level) handler (for example in an [[event loop]]) that catches exceptions before they reach the runtime.<ref name="cocoa"/><ref name="pmotw">PyMOTW (Python Module Of The Week), "[https://pymotw.com/2/sys/exceptions.html Exception Handling] {{webarchive|url=https://web.archive.org/web/20150915032624/https://pymotw.com/2/sys/exceptions.html |date=2015-09-15 }}"</ref>
|