Posts Tagged ‘VS 2010’

Tuple in C# 4.0

Posted: November 29, 2009 in .NET, C#
Tags: ,

Tuple provides us with a way to group elements of disparate data types together.This is present in functional languages like Haskell and also dynamic languages like Python.A common example of a tuple is a pair of coordinates defining a point in two dimensional space.In Haskell a tuple storing name and age of person is defined [...]

Laziness in C# 4.0 – Lazy<T>

Posted: October 4, 2009 in .NET, C#
Tags: , ,

“Lazy Instantiation” defers creation of an object till the time it is actually accessed.The process of object creation is always expensive as it involves allocation of memory on the heap.So Lazy Instantiation optimizes resources by using them when it is actually required.Till C# 3.0 we needed to some custom coding to implement “Lazy Instantiation” pattern.Now [...]

Dynamic in C# – Part3

Posted: September 19, 2009 in .NET, C#
Tags: , ,

In the last two posts we have discussed about dynamic languages and how DLR allows dynamic languages to run on CLR.In this post we will take a look into the new “dynamic” type in C# and how it works internally. Let us take a look into the following lines of code:

In my last post I had discussed about optional arguments and default values.In continuation to that today we will take a look into the named arguments feature.Let us consider the method definition and invocation as shown below: Here the PrintName method is invoked using what is called positional arguments where the value of the parameters [...]

I have recently downloaded the Visual Studio 2010 Beta 1 and started looking into the .NET Framework 4.0/IDE features.In the next couple of posts I will be discussing about these.To start with I have chosen optional parameters and default values.This feature is nothing new and has been there in languages like C++ for quite long.We [...]