Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
GeneralRe: NULLABLE type Pin
Rick Shaub28-Oct-09 8:11
Rick Shaub28-Oct-09 8:11 
GeneralRe: NULLABLE type Pin
Keith Barrow28-Oct-09 14:38
professionalKeith Barrow28-Oct-09 14:38 
GeneralRe: NULLABLE type Pin
vtchris-peterson28-Oct-09 10:02
vtchris-peterson28-Oct-09 10:02 
GeneralRe: NULLABLE type Pin
Keith Barrow28-Oct-09 14:25
professionalKeith Barrow28-Oct-09 14:25 
GeneralRe: NULLABLE type Pin
vtchris-peterson28-Oct-09 14:53
vtchris-peterson28-Oct-09 14:53 
GeneralRe: NULLABLE type Pin
Keith Barrow29-Oct-09 0:17
professionalKeith Barrow29-Oct-09 0:17 
GeneralRe: NULLABLE type Pin
vtchris-peterson29-Oct-09 4:10
vtchris-peterson29-Oct-09 4:10 
GeneralRe: NULLABLE type Pin
Keith Barrow29-Oct-09 5:14
professionalKeith Barrow29-Oct-09 5:14 
vtpdawg wrote:
Here, null is used as a return for standard deviation if the set to calculate is invalid (e.g. null, empty, or < 2 elements).

The Mode method, this could be a valid use of null as a set like {1,2,3,4} doesn't have a single modal value (unlike {1,1,2,3,4}. Null isn't "zero" or an empty string or somesuch, it really denotes the abscence of anything. Though equally could implement the Method so that it throws an exception if the set doesn't have a mode. The author of the article states that he returns null as this is what Excel does. You pays your money, you takes your choice on this I think.

vtpdawg wrote:
Here, null is used as a return for standard deviation if the set to calculate is invalid (e.g. null, empty, or < 2 elements).

This is a different matter, the code definately should throw an error, as you can't perform SD calcs on such sets.

I know that Exceptions ring alarm bells as the perception is that they have bad performance. This is indeed true if a debug build is made, however when a live build is made the performance is close to events (which is, after all what they are underneath).

vtpdawg wrote:
I think I tend to like that better than an out parameter and a boolean return value, and is certainly preferable to returning a valid double in an error case.


Agreed, that would be an ugly solution, and as I have [hopefully successfuly] explained an unecessary one as it can be handled via exception.

CCC solved so far: 2 (including a Hard One!)

GeneralRe: NULLABLE type Pin
Mycroft Holmes28-Oct-09 14:53
professionalMycroft Holmes28-Oct-09 14:53 
GeneralRe: NULLABLE type Pin
Keith Barrow29-Oct-09 0:20
professionalKeith Barrow29-Oct-09 0:20 
QuestionOutlining option is not coming on right clicking in text Pin
abcurl28-Oct-09 2:19
abcurl28-Oct-09 2:19 
AnswerRe: Outlining option is not coming on right clicking in text Pin
Abhishek Sur28-Oct-09 3:31
professionalAbhishek Sur28-Oct-09 3:31 
AnswerRe: Outlining option is not coming on right clicking in text Pin
Richard MacCutchan28-Oct-09 4:02
mveRichard MacCutchan28-Oct-09 4:02 
QuestionRe: Outlining option is not coming on right clicking in text Pin
abcurl28-Oct-09 4:19
abcurl28-Oct-09 4:19 
GeneralRe: Outlining option is not coming on right clicking in text Pin
Richard MacCutchan28-Oct-09 4:52
mveRichard MacCutchan28-Oct-09 4:52 
QuestionRegular Expression Find And Replace ? Pin
Jacobb Michael28-Oct-09 2:10
Jacobb Michael28-Oct-09 2:10 
AnswerRe: Regular Expression Find And Replace ? Pin
Philip Tyre28-Oct-09 3:09
Philip Tyre28-Oct-09 3:09 
Questionresize user control Pin
User 663428928-Oct-09 2:10
User 663428928-Oct-09 2:10 
AnswerMessage Closed Pin
28-Oct-09 2:15
stancrm28-Oct-09 2:15 
GeneralRe: resize user control Pin
User 663428928-Oct-09 2:37
User 663428928-Oct-09 2:37 
GeneralMessage Closed Pin
28-Oct-09 3:22
stancrm28-Oct-09 3:22 
GeneralRe: resize user control Pin
User 663428928-Oct-09 3:34
User 663428928-Oct-09 3:34 
GeneralMessage Closed Pin
28-Oct-09 3:49
stancrm28-Oct-09 3:49 
GeneralRe: resize user control Pin
User 663428928-Oct-09 4:09
User 663428928-Oct-09 4:09 
GeneralRe: resize user control Pin
musefan28-Oct-09 3:40
musefan28-Oct-09 3:40 

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.