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

C#

 
AnswerRe: When the finally code is executed? Pin
musefan30-Jun-09 22:00
musefan30-Jun-09 22:00 
GeneralRe: When the finally code is executed? Pin
dojohansen30-Jun-09 22:54
dojohansen30-Jun-09 22:54 
GeneralRe: When the finally code is executed? Pin
musefan30-Jun-09 23:08
musefan30-Jun-09 23:08 
GeneralRe: When the finally code is executed? Pin
dojohansen30-Jun-09 23:26
dojohansen30-Jun-09 23:26 
GeneralRe: When the finally code is executed? Pin
J4amieC30-Jun-09 23:45
J4amieC30-Jun-09 23:45 
GeneralRe: When the finally code is executed? Pin
dojohansen1-Jul-09 0:40
dojohansen1-Jul-09 0:40 
GeneralRe: When the finally code is executed? Pin
musefan1-Jul-09 0:55
musefan1-Jul-09 0:55 
GeneralRe: When the finally code is executed? Pin
musefan1-Jul-09 2:08
musefan1-Jul-09 2:08 
Just for any who are interested then dojohansen sent me an email with the following content...

Hi,

I don't want the thread to degenerate into a petty fight between you and me about whether or not we contributed something. But I do want to replay to *you* - hence this private message.



musefan wrote:Ungrateful for what? you didn't post anything that was designed to help me.

I said that the return is executed before the 'finally code' but the function is not complete (returned) until the finally code is processed.

I definitely said something that was meant to help, although it was not meant for you specifically. A reply in a forum is a reply to a message, not to the author of the message - if I wanted to address you I'd send a private message like this one.

What you said (as you accurately repeat in the above quote) is not wrong, but nor is it very precise. There's no mention of the crucial fact that the return value is evaluated before the finally executes[I said that the 'finally block' executes after the return - which to me is the same as saying "the return value is evaluated before the finally executes"]. There is also nothing that can help your reader understand that it would make a difference if the method worked with a reference type rather than a value type[personally I see the OP as simply asking if finally code is executed before or after the return statement. Not "how do I add to a variable before returning the value?"].

So although I feel people ought to be very happy to be corrected, and I try to be so myself when I am, this message was not even an attempt to correct you. I merely tried to clarify further and add some information regarding the subtleties that arise from the fact that the return value is evaluated before the finally block runs and returned afterwards.

To this, you gave a reply that was less than useless. Having first misinterpreted my message as a correction you decided to give me a snotty reply accusing me of trying to score brownie points by repeating you[I did not accuse you of 'stealing' my answer]. Frankly I feel that if you thought that was what I was doing you should be kind enough to the rest of the community to either just forget about it, or alternatively bring it up in a private message. [the impression I got (intended or not) was that you were correcting me and then saying it was the same answer - to me that warrants a telling off]



musefan wrote:Anyway, my point is I don't appreciate something thinking there correcting me by basically saying the same thing.

You appear very insecure to be so touchy about what you perceive as being corrected[insecurity is irrelevant here and therefore I can only assume it is meant as a dig]. Perhaps you should consider, if someone does some day write the same thing as you, the possibility that what you said wasn't very clear, or not complete, or that maybe the person had misunderstood your message. Immediately going for the knee-jerk reaction and attacking people for "copying" you makes you look fairly stupid, especially if the people you accuse of doing so are making contributions of superior quality to your own.[yeah maybe I could have handled it differently but you clearly misunderstood my answer and therefore instead of 'correcting' it then you should say you don't understand]

All of this having been said, I hope we can both contribute constructively to the forums and the community and not have to waste time on silly ego-driven [I am on an internet forum that does not display my real name - my ego is not effected either way by any post from anyone] activities that just pollute the threads for anyone interested in the *issue* we're supposed to discuss[people don't have to read what they don't think is worth reading].

Have a nice day,

Dag Johansen


...I don't have a problem being corrected when I am wrong (I am also a user of this forum to learn in addition to help) But there are some comments in this email that I don't see to make sense (which lead me to believe my original 'answer' requires more intelligence to interpret than I had hoped) but maybe that's just my opinion. everyone else if welcome to form there own. My comments on the email are in square brackets [ ] BTW

Life goes very fast. Tomorrow, today is already yesterday.

GeneralRe: When the finally code is executed? Pin
J4amieC1-Jul-09 2:12
J4amieC1-Jul-09 2:12 
GeneralRe: When the finally code is executed? Pin
musefan1-Jul-09 2:19
musefan1-Jul-09 2:19 
GeneralRe: When the finally code is executed? Pin
dojohansen1-Jul-09 5:44
dojohansen1-Jul-09 5:44 
GeneralRe: When the finally code is executed? Pin
dojohansen1-Jul-09 5:37
dojohansen1-Jul-09 5:37 
GeneralRe: When the finally code is executed? Pin
dojohansen1-Jul-09 5:59
dojohansen1-Jul-09 5:59 
AnswerRe: When the finally code is executed? Pin
dojohansen30-Jun-09 22:25
dojohansen30-Jun-09 22:25 
AnswerRe: When the finally code is executed? Pin
Fired.Fish.Gmail1-Jul-09 0:39
Fired.Fish.Gmail1-Jul-09 0:39 
GeneralRe: When the finally code is executed? Pin
dojohansen1-Jul-09 0:43
dojohansen1-Jul-09 0:43 
GeneralRe: When the finally code is executed? Pin
Fired.Fish.Gmail1-Jul-09 0:46
Fired.Fish.Gmail1-Jul-09 0:46 
QuestionTrouble with making multiple httpWebRequest "Get"'s to a webservice in a short time Pin
nineismine30-Jun-09 20:39
nineismine30-Jun-09 20:39 
AnswerRe: Trouble with making multiple httpWebRequest "Get"'s to a webservice in a short time Pin
Philip.F30-Jun-09 20:49
Philip.F30-Jun-09 20:49 
GeneralRe: Trouble with making multiple httpWebRequest "Get"'s to a webservice in a short time Pin
kstls30-Jun-09 22:50
kstls30-Jun-09 22:50 
GeneralRe: Trouble with making multiple httpWebRequest "Get"'s to a webservice in a short time Pin
nineismine1-Jul-09 2:29
nineismine1-Jul-09 2:29 
GeneralRe: Trouble with making multiple httpWebRequest "Get"'s to a webservice in a short time Pin
Philip.F1-Jul-09 3:18
Philip.F1-Jul-09 3:18 
QuestionData Entry in GridView Control Pin
Mads11530-Jun-09 20:08
Mads11530-Jun-09 20:08 
AnswerRe: Data Entry in GridView Control Pin
Chetan Patel30-Jun-09 20:15
Chetan Patel30-Jun-09 20:15 
AnswerRe: Data Entry in GridView Control Pin
Niladri_Biswas30-Jun-09 20:23
Niladri_Biswas30-Jun-09 20:23 

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.