Click here to Skip to main content
15,881,667 members
Home / Discussions / C#
   

C#

 
AnswerRe: 'out' keyword, to use or not to use Pin
Bernhard Hiller19-Apr-16 21:25
Bernhard Hiller19-Apr-16 21:25 
GeneralRe: 'out' keyword, to use or not to use Pin
Foothill20-Apr-16 3:16
professionalFoothill20-Apr-16 3:16 
AnswerRe: 'out' keyword, to use or not to use Pin
V.19-Apr-16 22:04
professionalV.19-Apr-16 22:04 
GeneralRe: 'out' keyword, to use or not to use Pin
Foothill20-Apr-16 3:13
professionalFoothill20-Apr-16 3:13 
AnswerRe: 'out' keyword, to use or not to use Pin
OriginalGriff19-Apr-16 23:00
mveOriginalGriff19-Apr-16 23:00 
GeneralRe: 'out' keyword, to use or not to use Pin
Foothill20-Apr-16 3:23
professionalFoothill20-Apr-16 3:23 
GeneralRe: 'out' keyword, to use or not to use Pin
OriginalGriff20-Apr-16 3:50
mveOriginalGriff20-Apr-16 3:50 
GeneralRe: 'out' keyword, to use or not to use Pin
Foothill20-Apr-16 4:15
professionalFoothill20-Apr-16 4:15 
Ah, makes sense. The article was a good read but, since my knowledge of the exact operation of the CLR is incomplete, I have a question.

Is there a computational difference between these two code blocks?
C#
try
{
  // code that throws an exception
}
catch (Exception)
{
  return false;
}

try
{
  // code that throws an exception
}
catch
{
  return false;
}

I am curious if there are certain methods of exception handling that don't unwind the call stack and don't create any additional overhead when the exception occurs. I can see this to be more appropriate in situations where I need the code to just reply, 'Sorry Dave, I'm afraid I can't do that' instead, as exceptions are appearing to be, calling the fire department. In this sense, when iterating through ten million rows in a database that requires you to convert strings to numbers and dates (which is understandably poor design), I would think it would be better to hit the exception and pass over it, possibly flagging it for later remediation, without creating a whole lot of exception overhead so that processing millions of rows could be done in seconds instead of minutes. Am I in the ballpark with this one?
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016

GeneralRe: 'out' keyword, to use or not to use Pin
OriginalGriff20-Apr-16 4:30
mveOriginalGriff20-Apr-16 4:30 
GeneralRe: 'out' keyword, to use or not to use Pin
Foothill20-Apr-16 5:00
professionalFoothill20-Apr-16 5:00 
GeneralRe: 'out' keyword, to use or not to use Pin
OriginalGriff20-Apr-16 5:12
mveOriginalGriff20-Apr-16 5:12 
GeneralRe: 'out' keyword, to use or not to use Pin
Foothill20-Apr-16 5:41
professionalFoothill20-Apr-16 5:41 
GeneralRe: 'out' keyword, to use or not to use Pin
OriginalGriff20-Apr-16 6:22
mveOriginalGriff20-Apr-16 6:22 
GeneralRe: 'out' keyword, to use or not to use Pin
Foothill20-Apr-16 7:16
professionalFoothill20-Apr-16 7:16 
AnswerRe: 'out' keyword, to use or not to use Pin
Pete O'Hanlon19-Apr-16 23:01
mvePete O'Hanlon19-Apr-16 23:01 
GeneralRe: 'out' keyword, to use or not to use Pin
Nathan Minier20-Apr-16 1:51
professionalNathan Minier20-Apr-16 1:51 
GeneralRe: 'out' keyword, to use or not to use Pin
Pete O'Hanlon20-Apr-16 2:06
mvePete O'Hanlon20-Apr-16 2:06 
GeneralRe: 'out' keyword, to use or not to use Pin
Nathan Minier20-Apr-16 2:17
professionalNathan Minier20-Apr-16 2:17 
GeneralRe: 'out' keyword, to use or not to use Pin
Pete O'Hanlon20-Apr-16 2:36
mvePete O'Hanlon20-Apr-16 2:36 
GeneralRe: 'out' keyword, to use or not to use Pin
Foothill20-Apr-16 3:42
professionalFoothill20-Apr-16 3:42 
GeneralRe: 'out' keyword, to use or not to use Pin
Richard Deeming20-Apr-16 4:19
mveRichard Deeming20-Apr-16 4:19 
AnswerRe: 'out' keyword, to use or not to use Pin
Ian A Davidson20-Apr-16 0:09
Ian A Davidson20-Apr-16 0:09 
GeneralRe: 'out' keyword, to use or not to use Pin
Foothill20-Apr-16 4:34
professionalFoothill20-Apr-16 4:34 
QuestionWhile button is clicked Pin
tvks19-Apr-16 8:30
tvks19-Apr-16 8:30 
AnswerRe: While button is clicked Pin
clapclap19-Apr-16 8:32
clapclap19-Apr-16 8:32 

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.