Welcome to MSDN Blogs Sign in | Join | Help

January 2006 - Posts

Neighbourhood super-hero LINQ comes to the rescue

I was just reading Mike Stall's blog Fun with yield, generics, foreach . He discusses using enumeration with yield and generics. The example he uses is a heterogenous array object[] list = new object[] {1,2, "abc", 5f, "def" } ; and he needs to print
Posted by abhinaba | 4 Comments
Filed under:

typedef is good for your wrist but not for your social life

Sometimes, we find many of our favourite features missing in a language. The instant reaction is that we crib (yea, I do this a lot :-) ) and raise it as a short-coming of that language. Most language features are pretty simple to be implemented in a
Posted by abhinaba | 17 Comments
Filed under:

Customers rule

I develop commercial software which is critical for our customers' success. In this effort we always take decision in favor of the customer. The customer rules!!! Many times the decisions are not of great liking to the developers and we get into heated
Posted by abhinaba | 1 Comments
Filed under:

Aspect Oriented Programming using .NET

Some time back I wrote an article on AOP using .NET languages . It's a long post so bear with me. In case you are interested only about C# go down here What is AOP Aspect Oriented Programming or AOP is an interesting concept that can be applied to many
Posted by abhinaba | 21 Comments
Filed under:

Scheme of things

Unfortunately I did not attend MIT, and Scheme was not taught to us as one of the first languages :) . Our college used Prolog for similar purpose and I learned scheme much later. When I first started out what intrigued me most was that its one of the
Posted by abhinaba | 1 Comments
Filed under:

Vista Rocks!!!

And so does IE 7 and Office 12..... I am ashamed to admit that even though I work in Microsoft I never tried out the cool new products. Being a bit low on bug-count I decided to try out Vista (a.k.a. longhorn). I tried ugrading one of the not-so-high-end
Posted by abhinaba | 10 Comments
Filed under:

.NET API's are not always honest

First a quiz, assuming that all required priviledges are there what is the output of the following code. All the important bits are marked in bold class Program { static void Main( string [] args) { string dirName = @"c:\a." ; try { System.IO. Directory
Posted by abhinaba | 3 Comments
Filed under:

Time to be pushed out

On some weekends I bring my daughter to office. She's generally very pleased to be able to crawl all over and go where no baby has gone before . On two occasions she had firmly taken my chair and refused to get up . This really got me thinking, its not
Posted by abhinaba | 3 Comments
Filed under:

C# and const

When I first started developing programs using C# I had a lot of baggage that I carried over from C++. One of the programming good practices we used to follow in C++ is marking all instance methods (C++ folks insist on calling functions) that do not change
Posted by abhinaba | 6 Comments
Filed under:

Enumerting all values of an Enum

<to get all the values as an array see here > Sometimes you need to do something in code and you hit on a simple solution, and then you sit back and marvel on the design that lets you do that. Sometime back when writing my blog on the usage of console
Posted by abhinaba | 2 Comments
Filed under:

C# generics syntax is elegant

C# generics syntax is much better than the nearest contender C++. Consider the following generic declaration in C++ template < typename T> // can use <class T> as well class GenClass { }; I always felt the need to use the typename keyword
Posted by abhinaba | 8 Comments
Filed under:

Extending the team build web-view

<Update: Fixed so that you no longer need to copy the Microsoft.TeamFoundation.Build.Common.dll. Thanks to a Watson bug we got to this > We had a web-UI for Build Report but we do not have one for Build List. Sometime back we had customer queries
Posted by abhinaba | 9 Comments
Filed under:

C#2.0: Generic methods, delegates and type inference...

I did not like var in C# 3.0 because I felt it reduces code readability. For the same reason I do not like using Type-Inference in C# 2.0 generics. class MyClass { public void MyMethod<T>(T value) { Console .WriteLine( "{0} {1}" , typeof (T).FullName,
Posted by abhinaba | 1 Comments
Filed under:

C#: Fast string comparison optimization

Sometime back I had blogged about using reference comparison to speed up ordinal string comparisons. Essentially this means that if you know for sure that your string is interned and you want to do an ordinal string comparison you can use the following
Posted by abhinaba | 19 Comments
Filed under:

Mixins and C#

In one of my previous lives when I first heard about mixin and tried to look it up I hit into various conflicting definitions. The definition of Mixin I settled for is " MixIn programming is a style of software development where units of functionality
Posted by abhinaba | 7 Comments
Filed under:

Its not a good idea to use Console colors too much

With Whidbey (VS2005) managed Console based applications have got a boost with new additions to the System.Console namespace. You can now change the color, size, buffer-size, cursor-size, cursor-position, window-title directly from a managed application
Posted by abhinaba | 8 Comments
Filed under:

C# 2.0: Protected member access and generics

Some time back I had posted about why protected member of a base class cannot be directly called from a derived class. The same thing holds for generic classes as well. However, protected member access rule has been updated in the C#2.0 spec to accomodate
Posted by abhinaba | 3 Comments
Filed under:

Stroustrup talks on V-Next of C++. Do they apply to C#?

For a long time I am out of touch with the C++ world. Amit pointed me to the paper A Brief Look at C++0x which talks about C++0x scheduled to be released in 2009. I loved some of the new features. Some of the changes proposed in C++ brings it closer to
Posted by abhinaba | 4 Comments
Filed under:
 
Page view tracker