Talk:异常处理

页面内容不支持其他语言。
维基百科,自由的百科全书
基础条目 异常处理属于维基百科科技主题的基礎條目第五級。请勇于更新页面以及改進條目。
          本条目页属于下列维基专题范畴:
电脑和信息技术专题 (获评中重要度
本条目页属于电脑和信息技术专题范畴,该专题旨在改善中文维基百科資訊科技相关条目类内容。如果您有意参与,请浏览专题主页、参与讨论,并完成相应的开放性任务。
 未评级未评  根据专题质量评级标准,本条目页尚未接受评级。
   根据专题重要度评级标准,本條目已评为中重要度

In software部分的翻译[编辑]

Kiniry also notes that "Language design only partially influences the use of exceptions, and consequently, the manner in which one handles partial and total failures during system execution. The other major influence is examples of use, typically in core libraries and code examples in technical books, magazine articles, and online discussion forums, and in an organization’s code standards."

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.

这两段有点难理解

九千鸦留言2020年2月3日 (一) 09:07 (UTC)[回复]

简介部分[编辑]

原文中的这一块(已删除)

各种编程语言在处理异常方面具有非常显著的不同点(错误检测与异常处理区别在于:错误检测是在正常的程序流中,处理不可预见问题的代码,例如一个调用操作未能成功结束)。某些编程语言有这样的函数:当输入存在非法数据时不能被安全地调用,或者返回值不能与异常进行有效的区别。例如,C语言中的atoi函数(ASCII串到整数的转换)在输入非法时可以返回0。在这种情况下编程者需要另外进行错误检测(可能通过某些辅助全局变量如C的errno),或进行输入检验(如通过正则表达式),或者共同使用这两种方法。

以及这一块:(未翻译)

Alternative approaches to exception handling in software are error checking, which maintains normal program flow with later explicit checks for contingencies reported using special return values or some auxiliary global variable such as C's errno or floating point status flags; or input validation to preemptively filter exceptional cases.

这两块觉得很奇怪。

九千鸦留言2020年2月4日 (二) 09:21 (UTC)[回复]