Browse by Tags
All Tags »
C# 2.0 (
RSS)
The CLR’s exception handling facilities provide for protected blocks (“try”) one can associate a handler with. There are four kinds of handlers, and exactly one can be associated with a protected block (but nesting can be used to associate multiple handlers...
A few days ago I had a derailed conversation on C# languages features once more. It turned out that closures are not well-understood in general, so I wanted to point out a few things in an attempt to clarify the concept and how it’s implemented in the...
Everyone knows array initializers; they’ve been part of the language since the very beginning. But do you know how this innocent looking construct really works? var ints = new [] { 1, 2, 3 }; Before we continue, I should point out that the above sample...
Answers to the C# Quiz - Fun with System.Xml . Here's a quick refresh of the problem: Copy Code 1 using System; 2 using System.Xml; 3 4 class Program 5 { 6 static void Main() 7 { 8 new Bar < int > ().CreateBar < double > ( " Bart "...
A simple quiz today; it's rather a System.Xml debugging job. With this I've said too much already. Here it is: Copy Code 1 using System; 2 using System.Xml; 3 4 class Program 5 { 6 static void Main() 7 { 8 new Bar < int > ().CreateBar < double...
On the last edition of Developer & IT Pro Days in Belgium last week, Raj Pai - program manager on the C# team at MS Corp - delivered the first public demo of PLINQ aka Parallel LINQ . Let's have a quick look... By now, every blog reader should be...
You can find the original quiz over here . There have been lots of great answers, thanks to all readers! The bottom line however is that one should be careful when doing performance optimizations; in much cases the code doesn't become cleaner (even the...
Last week, I introduced C# 2.0 to a few academic people who had prior exposure to C, C++ and Java. Does language matter is an often heard question. Well, in the world of .NET, the importance of language choice has somewhat blurred but richness of languages...
This quiz was derived from an old piece of code I reviewed for a student's project somewhere in the past. Actually, I was doing some perf-related work today, so I thought it might be useful to have a little quiz around this. Below is the code (reduced...
A little different quiz approach today; starting from IL :-). The question is pretty simple: when does the C# compiler emit a call instruction instead of a callvirt instruction? A little sample to illustrate the non-trivial character of this question...
More Posts
Next page »