你的位置: 码友网首页 / 资讯源列表 / Using Multiple Return Values instead of Exceptions

关于[Using Multiple Return Values instead of Exceptions]的摘要:

A question that frequently arises in software engineering is whether/when you should throw exceptions or return error codes. There are many different opinions about this subject, and there’s a large number of C#/Java developers who throw Exceptions to indicate all kinds of errors. However, there’s also a large number of developers who believe that Exceptions should not be used as control flow and argue that exceptions act like non-local GOTO statements but even more evil because it’s difficult to know where the control goes to (some people compare exceptions to invisible gotos or gotos which lead to invisible labels).

原文地址: https://drizin.io/using-multiple-return-values-instead-of-exceptions/

收录时间: 2021-01-04 浏览量: 969 分类: .NET

| 1 收藏 | 0