Generic and specific return types It is often preferred to work with as generic types as possible. Doing that opens up for more flexibility and being able to modify parts of the code without effecting any other parts. One example of this is IEnumerable<T> which is implemented by several generic collection types, such as HashSet<T>, […]
A little bit on strings Strings in C# are immutable. What that means is that you cannot modify an existing string, you must create a new one. Also strings are objects – sequential read only collections of char objects – so they are allocated on the managed heap, and therefore managed by the Garbage Collector […]
Non-generic- vs generic collections When coding in C# you will pretty soon encounter Collections (Lists, Queues, Stacks, and so on). As soon as you wish to use a Collection of some sort you will have the choice of using one from the System.Collections namespace or one from the System.Collections.Generic namespace. The most commonly used Collection […]
I am now moving in here at http://www.ericbackhage.net. Old blog posts will be left at the old site, http://thecodedworld.blogspot.com. Looking forward to getting this new blog going.