Posted on July 25th, 2007 by Paul Stovell
One advantage functional programming has over imperative programming is that in most functional languages, many of the operations performed are stateless - you pass values in, you get values back, but they never rely on external resources (global variables, static variables, the file system, the registry, etc.). This allows the runtimes of these languages to […]
Filed under: C# | 8 Comments »
Posted on March 7th, 2007 by Paul Stovell
When you write custom classes in C# as often as I do, you begin to get somewhat sick of having to type out backing fields and property getters/setters for a whole load of properties in a class. I’ve used a number of tools and shortcuts to make this easy, such as the “prop” snippet in […]
Filed under: C# | 10 Comments »
Posted on December 14th, 2005 by Paul Stovell
If you haven’t had chance to look at Code Snippets in Visual Studio 2005, you should. Anyway, I just wanted to share one that I just made to create an event along with the method to raise it:
When you press ‘Enter’ after filling in all the fields, the cursor moves to the “Occurs when” summary […]
Filed under: C# | 3 Comments »
Posted on October 5th, 2005 by Paul Stovell
Pop quiz time. Lets say I have a List<T> of items and I do this:
list[5] = MethodCall();
You can guess there will be an IndexOutOfBoundsException, but the code in MethodCall will be executed first. But what if I had this statement, where I have a List<T> of List<T>?
list[5][0] = MethodCall();
Does the code […]
Filed under: C# | No Comments »