Click here to Skip to main content
15,921,250 members
Home / Discussions / C#
   

C#

 
GeneralRe: Throwing exception when a property must not be null? Pin
Paul Riley11-Sep-02 13:26
Paul Riley11-Sep-02 13:26 
GeneralRe: Throwing exception when a property must not be null? Pin
leppie11-Sep-02 16:37
leppie11-Sep-02 16:37 
GeneralRe: Throwing exception when a property must not be null? Pin
Paul Riley11-Sep-02 23:43
Paul Riley11-Sep-02 23:43 
GeneralRe: Throwing exception when a property must not be null? Pin
leppie12-Sep-02 2:08
leppie12-Sep-02 2:08 
GeneralRe: Throwing exception when a property must not be null? Pin
Paul Riley12-Sep-02 2:52
Paul Riley12-Sep-02 2:52 
GeneralRe: Throwing exception when a property must not be null? Pin
leppie12-Sep-02 3:50
leppie12-Sep-02 3:50 
GeneralRe: Throwing exception when a property must not be null? Pin
Martin Haesemeyer10-Sep-02 10:06
Martin Haesemeyer10-Sep-02 10:06 
GeneralRe: Throwing exception when a property must not be null? Pin
Erik Westermann10-Sep-02 15:48
professionalErik Westermann10-Sep-02 15:48 
Martin Häsemeyer wrote:
Wouldn't this be a bad design, too?

How so? You know the exact nature of the problem based on the exception's type. Besides, all exceptions are derivatives of System.Exception; as a result, if you code your catch blocks properly, you'll be able to handle errors from both libraries in this scenario.


Martin Häsemeyer wrote:
And why is it more exceptional if you pass an invalid "null" argument to a clr function than to a function of a third party library?

It isn't. It depands on what the class' designer is atembpting to achieve. An exception is designed to, ultimately, halt your code if it is allowed to 'bubble up' through to the system regardless of what type of exception gets thrown. Exceptons are non-local control structures that let you centralize error handling in one part of your application as opposed to having you sprinkle if statements throughout your code. In some cases; however, it is more approprate a number of cases to use a less computationally expensive means of handling an error.

Erik Westermann
Author, Learn XML In A Weekend (October 2002)
GeneralRe: Throwing exception when a property must not be null? Pin
jparsons10-Sep-02 5:07
jparsons10-Sep-02 5:07 
GeneralRe: Throwing exception when a property must not be null? Pin
stephen woolhead13-Sep-02 10:48
stephen woolhead13-Sep-02 10:48 
GeneralAdjusting colors Pin
Nnamdi Onyeyiri7-Sep-02 23:49
Nnamdi Onyeyiri7-Sep-02 23:49 
GeneralRe: Adjusting colors Pin
Stephane Rodriguez.8-Sep-02 0:25
Stephane Rodriguez.8-Sep-02 0:25 
GeneralRe: Adjusting colors Pin
Nnamdi Onyeyiri8-Sep-02 1:07
Nnamdi Onyeyiri8-Sep-02 1:07 
GeneralRe: Adjusting colors Pin
Nnamdi Onyeyiri8-Sep-02 1:44
Nnamdi Onyeyiri8-Sep-02 1:44 
GeneralRe: Adjusting colors Pin
Stephane Rodriguez.8-Sep-02 2:07
Stephane Rodriguez.8-Sep-02 2:07 
GeneralRe: Adjusting colors Pin
Nnamdi Onyeyiri8-Sep-02 2:13
Nnamdi Onyeyiri8-Sep-02 2:13 
GeneralRe: Adjusting colors Pin
James T. Johnson8-Sep-02 11:52
James T. Johnson8-Sep-02 11:52 
Generalusing Systen.Windows.Forms namespace Pin
kab7-Sep-02 19:17
kab7-Sep-02 19:17 
GeneralRe: using Systen.Windows.Forms namespace Pin
Paul Riley8-Sep-02 0:05
Paul Riley8-Sep-02 0:05 
QuestionIs RegExp The Best Way to Go? Pin
MStanbrook7-Sep-02 10:57
MStanbrook7-Sep-02 10:57 
AnswerRe: Is RegExp The Best Way to Go? Pin
Martin Haesemeyer7-Sep-02 23:59
Martin Haesemeyer7-Sep-02 23:59 
AnswerRe: Is RegExp The Best Way to Go? Pin
Eric Gunnerson (msft)9-Sep-02 5:34
Eric Gunnerson (msft)9-Sep-02 5:34 
QuestionAnyone want to help design this? Pin
Alex Korchemniy7-Sep-02 10:38
Alex Korchemniy7-Sep-02 10:38 
AnswerRe: Anyone want to help design this? Pin
Nnamdi Onyeyiri7-Sep-02 11:49
Nnamdi Onyeyiri7-Sep-02 11:49 
AnswerRe: Anyone want to help design this? Pin
Paul Riley7-Sep-02 13:16
Paul Riley7-Sep-02 13:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.