Exceptions: When to use, timing, overall use

后端 未结 6 1534
-上瘾入骨i
-上瘾入骨i 2020-12-20 07:47

I\'ll try and ask my question so it doesn\'t end as a simple argumentative thread.

I\'ve jumped into an application coded in C# recently and I\'m discovering the exc

6条回答
  •  半阙折子戏
    2020-12-20 08:23

    Programs that use exceptions as part of their normal processing suffer from all the readability and maintainability problems of classic spaghetti code.

    — Andy Hunt and Dave Thomas

    I think there is no simple right answer about how/when to use exceptions. It depends on an architecture of the application you're working on and other factors.

    I can suggest you to read the chapters 8.3. Error-Handling Techniques and 8.4. Exceptions of the Code Complete book.

提交回复
热议问题