Welcome to MSDN Blogs Sign in | Join | Help

November 2005 - Posts

C# 2.0: Using different versions of the same dll in one application

Lot of things have become really easy to do in C#2.0. I needed to load 2 versions of the same class library dll in my application. The format of output file had changed between versions. So I need to deserialize an xml using the older version and then
Posted by abhinaba | 8 Comments
Filed under:

C# 2.0: no more lexer blues with nested templates

When generics got announced and I laid my hands on the C#2.0 compiler the first thing I tried is nested template usage. This C++ compiler (spec actually) gave me enough pain with this. Consider the following C++ code which uses the STL. #include "vector"
Posted by abhinaba | 0 Comments
Filed under:

C#: PG required, obscene case fall through code and Duff device

I had said before that I miss case fall through in C# and I promised that I'd write about some weird uses of this feature in C++. I think the weirdest use of case statement was made by Tom Duff. He needed to write some code in C that copied an array of
Posted by abhinaba | 6 Comments
Filed under:

C# : I hate commented out code

Even though retaining commented lines of code in your source-base is not a good thing, it's a fact that they do exist. Whenever I see a chunk of code commented out I first make a yucky face and then the next thing that comes to my mind is why did someone
Posted by abhinaba | 10 Comments
Filed under:

TeamBuild: Scheduled build using Team System

Sorry to all the folks who read my blog for C#. This ones about Team System and specifically about the Team Build module :) Team Build does not have any in-built scheduler and so it does not provide scheduled builds out of the box. However, it does have
Posted by abhinaba | 9 Comments
Filed under:

C#: I miss case fall through

We all have heard time and again that the default case fall through is not good (as in C/C++) and C# does not allow it . There has been enough debate on this but I still differ on this. I used to like it a lot and somehow when I do need to use it the
Posted by abhinaba | 23 Comments
Filed under:

C# 2.0: Loading plugins at run-time using late binding

I was working on a home project for creating a motion-detector that works using a webcam. Instead of using a baby-monitor I am planning to run this on an old computer. I'll point the web-cam to my daugthers' crib and the program would monitor both sound
Posted by abhinaba | 28 Comments
Filed under:

C# 2.0: get and set accessor can have different accessibility

One of the issues with properties in C#1.x is that the get and the set accessors get the same accessibility. In some situations you'd want to impose more usage restriction on the set accessor then on get . In the following sample both the get and set
Posted by abhinaba | 3 Comments
Filed under:

C#: Why I cannot call protected method from derived class

Someone posted a comment in the internal alias on protected member access. The question is that the following code does not compile with the error " cannot access protected member Class1.Foo() " public class Class1 { protected void Foo() { } } public
Posted by abhinaba | 3 Comments
Filed under:

C#: Uninitialized instance variables

int i; Console .WriteLine(i); The above code will fail to compile. This is because the C# compiler requires a variable to be definitely assigned at the location where it is used. It figures this out using static flow analysis and the above case is the
Posted by abhinaba | 5 Comments
Filed under:

C#: Linked by the great Raymond Chen

So I won an Oscar too :) and was honored with a link from Raymond Chen . Sometime back I posted on including try/catch/ retry block in C# and he is recommending not using such automatic retrying. However, I do not agree with the flat recommendation and
Posted by abhinaba | 3 Comments
Filed under:

We're on Channel 9

Kaushal from Microsoft Bangalore was here in Hyderabad some time back. He shot some video of the folks here, including some from VSTS-Team Build. The video is on http://channel9.msdn.com/Showpost.aspx?postid=143589 . See me and Anu giving a demo of Team
Posted by abhinaba | 0 Comments

C# 2.0: The all new ?? operator

Thanks to James Manning's blog I remembered the new ?? operator introduced in C#2.0 and that very few people seem to use it. This new ?? operator is mainly used for nullable types but can also be used with any reference type. Use with nullable type In
Posted by abhinaba | 7 Comments
Filed under:

C# 2.0: Fast string comparison with string-interning

<Also read the later posting on the same topic> Frequently in code we do string comparisons which is culture-agnostic. While we should follow the string comparison guidelines , there is a much faster way of getting it done using string interning
Posted by abhinaba | 9 Comments
Filed under:
 
Page view tracker