ITSWITCH #1: Answer

Last post I detailed some code that may or may not have something wrong in it.  If you thought InitializeOne and IntializeTwo are semantically identical (e.g. they differ only by performance), you’d be wrong. If you simply ran the code, you’d be able to guess where the problem is.  To understand what’s causing the problem.  Let’s look at how C# effectively implements the two loops. InitializeOne is essentially equivalent to         private class PrivateDelegateHelper         {             public String Value { get; set; }             public void Method()             {                 TestClass.ProcessText(Value);             }         }           public void … Continue reading ITSWITCH #1: Answer


Is There Something Wrong In This Code Here UPDATE: as several readers pointed out there was compile error in the code what was being displayed.  The line “String value = string[i]” was showing up as “String value = string”.  I’m not sure why; but throwing some spaces between the i and the square brackets seems to have solved it. In the following class, is there something wrong with either InitializeOne or InitializeTwo (hint, it has nothing to do with compile errors and I’m ignoring performance differences)?     public class TestClass     {         private List<MethodInvoker> delegates;           private … Continue reading ITSWITCH: #1