Talk:Programming language: Difference between revisions

Content deleted Content added
Edit request: remove substed templates, actioned the requests
Line 152:
[[User:Buidhe paid|Buidhe paid]] ([[User talk:Buidhe paid|talk]]) 17:48, 23 January 2024 (UTC)
:{{Done}} Both. [[User:Sohom Datta|Sohom]] ([[User talk:Sohom Datta|talk]]) 18:06, 23 January 2024 (UTC)
{{edit COI}}
Please add the following text just before the "Concurrency" section:
{{collapse top}}
===Exception handling===
{{main|Exception handling}}
Many programming languages include exception handlers, a section of code triggered by [[runtime error]]s that can deal with them in two main ways:{{sfn|Sebesta|2012|pp=630, 634}}
*Termination: shutting down and handing over control to the [[operating system]]. This option is considered the simplest.
*Resumption: resuming the program near where the exception occurred. This can trigger a repeat of the exception, unless the exception handler is able to modify values to prevent the exception from reoccurring.
Some programming languages support dedicating a block of code to run regardless of whether an exception occurs before the code is reached; this is called finalization.{{sfn|Sebesta|2012|p=635}}
 
There is a tradeoff between increased ability to handle exceptions and reduced performance.{{sfn|Sebesta|2012|p=631}} Although programmers can write code to catch user-defined exceptions, this can clutter a program. Standard libraries in some languages, such as C, use their return values to indicate an exception.{{sfn|Sebesta|2012|p=632}} Some languages and their compilers have the option of turning on and off error handling capability, either temporarily or permanently.{{sfn|Sebesta|2012|pp=631, 635–636}}
{{talk ref}}
{{collapse bottom}}
Thanks [[User:Buidhe paid|Buidhe paid]] ([[User talk:Buidhe paid|talk]]) 19:27, 23 January 2024 (UTC)