From: Carlos G. A. <car...@te...> - 2003-04-11 12:34:34
|
Mike Scott wrote: > Hi Carlos > > I see that the code has lots of field initialisers. This is not a good idea > as the initialisation IL is duplicated by the C# compiler for each > constructor, and prefixed in front of each constructors code. > > In other words, if you have 4 constructors, the output file will have the > same code to initialise the fields repeated 4 times. > > This is obviously wasteful and bloats code unnecessarily. It is recommended > to initialise your fields in your default constructor, then have all the > constructors call base(). Huummmm, i have no notice about this :), are you sure about it ( i have started to make the change in my local tree but i want to be sure about this before commit it, but in any case i think this can be good ) -- Best regards Carlos Guzmán Álvarez Vigo-Spain "No tengo dones especiales.Sólo soy apasionadamente curioso" Albert Einstein, científico. |