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

C#

 
AnswerRe: Switch Behavior in C# Pin
Wendelius15-Nov-08 23:51
mentorWendelius15-Nov-08 23:51 
GeneralRe: Switch Behavior in C# Pin
Veldrain16-Nov-08 8:41
Veldrain16-Nov-08 8:41 
AnswerRe: Switch Behavior in C# Pin
Dave Kreskowiak16-Nov-08 5:00
mveDave Kreskowiak16-Nov-08 5:00 
GeneralRe: Switch Behavior in C# Pin
Mark Churchill16-Nov-08 12:59
Mark Churchill16-Nov-08 12:59 
GeneralRe: Switch Behavior in C# Pin
Mycroft Holmes16-Nov-08 15:39
professionalMycroft Holmes16-Nov-08 15:39 
GeneralRe: Switch Behavior in C# Pin
Mark Churchill16-Nov-08 16:01
Mark Churchill16-Nov-08 16:01 
GeneralRe: Switch Behavior in C# Pin
Mycroft Holmes16-Nov-08 17:19
professionalMycroft Holmes16-Nov-08 17:19 
GeneralRe: Switch Behavior in C# Pin
Mark Churchill16-Nov-08 17:32
Mark Churchill16-Nov-08 17:32 
Actually I think the example I made was overly complex - I wasnt trying to demonstrate anything to do with threading issues, probably wouldve been served better without the ThreadPool and by just adding the delegates to a List and then .Invoking them one by one. The output in either case will be "10, 10, 10..." - "i" gets captured by the closure, not the "current-value-of-i". By the time they actually are executed, i == 10. Leads to some horrible state if you aren't careful.

Resharper, incidently, will pick up the as access to a modified closure and warn you, but the default compiler doesnt seem to care.

I see gotos as a tool, to be used when appropriately. Its pretty rare that there isn't a better statement for the job. "Restricted" gotos like break, continue and return cover most bases anyway. Its just that one time you need the goto and everyone suddenly reacts like you are doing something intimate with your workstation that gets to me... Wink | ;)


Questioncomparing two datasets Pin
Melanie Booysen15-Nov-08 19:48
Melanie Booysen15-Nov-08 19:48 
AnswerRe: comparing two datasets Pin
Dave Kreskowiak16-Nov-08 4:58
mveDave Kreskowiak16-Nov-08 4:58 
QuestionTrusted & Digitially signed Files Pin
123pips15-Nov-08 10:00
123pips15-Nov-08 10:00 
QuestionTheadPool hanhs in release Pin
baranils15-Nov-08 6:33
baranils15-Nov-08 6:33 
Questiona password riddle Pin
nelsonpaixao15-Nov-08 5:54
nelsonpaixao15-Nov-08 5:54 
RantRe: a password riddle Pin
Vimalsoft(Pty) Ltd15-Nov-08 5:59
professionalVimalsoft(Pty) Ltd15-Nov-08 5:59 
GeneralRe: a password riddle Pin
Paul Conrad15-Nov-08 6:00
professionalPaul Conrad15-Nov-08 6:00 
GeneralRe: a password riddle Pin
Pete O'Hanlon15-Nov-08 11:07
mvePete O'Hanlon15-Nov-08 11:07 
AnswerRe: a password riddle Pin
Paul Conrad15-Nov-08 5:59
professionalPaul Conrad15-Nov-08 5:59 
GeneralRe: a password riddle Pin
Guffa15-Nov-08 14:13
Guffa15-Nov-08 14:13 
GeneralRe: a password riddle Pin
nelsonpaixao16-Nov-08 13:09
nelsonpaixao16-Nov-08 13:09 
GeneralRe: a password riddle Pin
Russell Jones17-Nov-08 0:32
Russell Jones17-Nov-08 0:32 
Questionc# Reflection Pin
koleraba15-Nov-08 5:19
koleraba15-Nov-08 5:19 
AnswerRe: c# Reflection Pin
S. Senthil Kumar15-Nov-08 19:19
S. Senthil Kumar15-Nov-08 19:19 
QuestionChat or IRC Pin
duta15-Nov-08 2:01
duta15-Nov-08 2:01 
AnswerRe: Chat or IRC Pin
EliottA15-Nov-08 5:49
EliottA15-Nov-08 5:49 
QuestionSafeHandle.SetOwnership(false) Pin
HosamAly15-Nov-08 1:47
HosamAly15-Nov-08 1:47 

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.