Since I’m a noob javascript programmer I tend not to write javascript code if possible, JQuery helped me a lot because it permits me to do complex thing in a very simple way, but quite often javascript continues to surprise me. Yesterday I had to write a really simple piece of js code, I have [...]
Continue reading about Javascript date UTC and Microsoft Ajax
The infrastructure of a project is really important for a lot of reasons, first of all it should make possible to accomplish standard tasks with simple code avoiding duplication. Lets do a little example. In .NET if you want to issue a simple query to a database you really have to do a lot of [...]
In last post Expression Tree vs Reflection I showed how to use Expression Tree to dynamically build a function object at runtime that you can use to invoke methods of unknown objects. This is a peculiar use of Expression Tree, but you can obtain the same result with Lightweight Code Generation (as some people commented [...]
Continue reading about Again on Expression Tree vs Reflection

In the last post I described a technique that uses Expression Tree to invoke dynamically methods of objects of types unknown at compile time. You can use this technique to build the ExpressionTreeReflection class. You can now write code like this private static readonly Type suType = Type.GetType("DotNetMarche.Common.Test.AuxClasses.SimpleUnknown, DotNetMarche.Common.Test"); private static readonly Object suInstance = [...]
Continue reading about Faster invoke method of unknown objects with Expression tree part2
Everyone knows that invoking method through reflection is slower than direct invocation, here is a little test. Int32 iterations = 100000; Stopwatch watch = new Stopwatch(); MyObject obj = new MyObject(); obj.Prop = 0; watch.Start(); for (Int32 I = 0; I < iterations; ++I) { obj.Prop = obj.Prop + 1; } watch.Stop(); Console.WriteLine("Direct invocation {0} [...]