juin 02
Recently, one of my colleague wanted to call an auto-implemented property setter in a class' constructor.
I do not think this is a good idea as we don't know how the class may evolve in the future.
In this post, I will show some of possible evolutions that make me think that we should not use auto-implemented properties in a class' constructor, but rather use a classical property and thus the member variable. [Plus]
Tags: | | | |
janv. 30
What is the visibility of private and protected members ? On which instance can you access them ?
When you use inheritance, does that change anything ?
Find here some recall about these visibility qualifiers. [Plus]
Tags: | | | |
oct. 10
You all know the "new" keyword that allows us to hide a method that has not been defined for overriding.
Of course "hiding" and "overriding" is different and the result will be different between calling a method "hidden" or overriden, depending of the static and dynamic type of the object on which we call the method.

In this post, I will quickly recall these differences thru examples.

Anyway, what happens with this keyword when you work with generic types ?
Well this is not so evident and you need to know exactly what is generated by the .NET framework when working with generics.
Once again, I will emphasize on this difference thru example using generics. [Plus]
Tags: | |
sept. 04
.NET has introduced since its very first version the concept of enumerations. It's of course quite nice and allow us to replace magic numbers in the code by self documented structure.

But their use is far over too common, without thinking before to the consequences of such a choice.
Find here some of my thoughts of dos and donts about enumerations. [Plus]
Tags: | |