Click here to Skip to main content
16,005,491 members
Home / Discussions / C#
   

C#

 
GeneralRe: Throwing exception when a property must not be null? Pin
Paul Riley10-Sep-02 4:50
Paul Riley10-Sep-02 4:50 
GeneralRe: Throwing exception when a property must not be null? Pin
Martin Haesemeyer10-Sep-02 9:56
Martin Haesemeyer10-Sep-02 9:56 
GeneralRe: Throwing exception when a property must not be null? Pin
Paul Riley10-Sep-02 10:10
Paul Riley10-Sep-02 10:10 
AnswerRe: Throwing exception when a property must not be null? Pin
Erik Westermann9-Sep-02 7:43
professionalErik Westermann9-Sep-02 7:43 
GeneralRe: Throwing exception when a property must not be null? Pin
Paul Riley9-Sep-02 9:34
Paul Riley9-Sep-02 9:34 
GeneralRe: Throwing exception when a property must not be null? Pin
Erik Westermann10-Sep-02 4:06
professionalErik Westermann10-Sep-02 4:06 
GeneralRe: Throwing exception when a property must not be null? Pin
Paul Riley10-Sep-02 4:47
Paul Riley10-Sep-02 4:47 
GeneralRe: Throwing exception when a property must not be null? Pin
Erik Westermann10-Sep-02 15:37
professionalErik Westermann10-Sep-02 15:37 
Paul Riley wrote:
I think an "Exception" is better described in the context of the program saying "I take exception to this scenario".

It really depends on what you're designing and what its purpose will be. I'm speaking in the snese of who the immediate user is of course. For example, if you're building a class library, you'll probably end up throwing exceptions since you may have no other means of reporting an error or the best way to handle the error is to let the code that called the code in the class library handle the error.

If you're building an applicaiton or a component that an end user will use then it is probably not a good idea to throw an exception since most typical end users don't know what to do when something 'wierd' happens.


Paul Riley wrote:
Wouldn't Object and Exception be better placed in a "Core" namespace?

That was Microsoft's choice.

Paul Riley wrote:
To argue that this is a system-level exception is ridiculous

It is a system-level exception, System.ArgumentNullException is a derivative of System.SystemException. The naming standard appears to focus on the source of the exception, not the entity that casued it.

Erik Westermann
Author, Learn XML In A Weekend (October 2002)
GeneralRe: Throwing exception when a property must not be null? Pin
Paul Riley11-Sep-02 1:23
Paul Riley11-Sep-02 1:23 
GeneralRe: Throwing exception when a property must not be null? Pin
leppie11-Sep-02 6:32
leppie11-Sep-02 6:32 
GeneralRe: Throwing exception when a property must not be null? Pin
Paul Riley11-Sep-02 7:04
Paul Riley11-Sep-02 7:04 
GeneralRe: Throwing exception when a property must not be null? Pin
leppie11-Sep-02 7:44
leppie11-Sep-02 7:44 
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 
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 

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.