Pef for fun – an interesting tool to promote TDD

Hi Folks, the PEX team has released on online version of their unit testing tool at http://www.pexforfun.com/ I found this to be a real fun way to explore and understand how Test Driven Development is all about. having said that, i’d like to add that PEX is much more than the above site. for more…


What happens when a constuctor is called

Consider the following class public class MyClass{    public int myField = 4;     public MyClass()    {        this.myField = 5;    }}  when we compile this class, we get an assembly with IL in it. The parameterless constructor gets converted into a method with the name .ctor Now, if we see the IL that gets generated for this .ctor method, we might expect it to have IL opcodes to assign the value…

2

what using the ‘using’ block in c# does to your code

Let us take a simple console application which has the below code written in it     class Program     {         static void Main(string[] args)         {             using (SqlConnection connection = new SqlConnection())             {                 connection.Open();                 connection.Close();             }         }     } the IL that gets generated for the above program…

2

Nice to have C# 5.0 LinQ feature

currently LinQ only supports projections, instead if we could perform an action for each row inside the linq query itself it would be great.  I had in mind something like the below query in mind. Hopefully C# team would consider this 🙂 Collection<DataEndpoint> myObjects = new Collection<DataEndpoint>(); var dataExtensions = from c in dataContext.ETDataExtensions                      join…

2

Want a treat? Get others to send you an invite :P

Here’s an example of my “idle mind at work”… writing code just for the heck of it… SendKeys.SendWait(“^({ESC})”); Thread.Sleep(500); SendKeys.SendWait(“run”); Thread.Sleep(1000); SendKeys.SendWait(“{ENTER}”); Thread.Sleep(500);   String currentRecepients = “<your To List>”;//Enter all emails separated by semi colons   SendKeys.SendWait(“mailto:” + currentRecepients + “;”;//+ WindowsIdentity.GetCurrent().Name.Split(‘\\’)[1]); Thread.Sleep(500); SendKeys.SendWait(“{ENTER}”); Thread.Sleep(500); SendKeys.SendWait(“treat from me at barista… today 4:30pm”); SendKeys.SendWait(“{TAB}”); SendKeys.SendWait(“no…


Once I was a College Student

<re-published from my old blog> So there I was, sitting at my desk staring at the computer screen working on VS 2010 and exploring a bit of F#. I just sat back and started reflecting on my college days and the interviewing season in the 7th semester. All of us, revising all our technical knowledge,…


Creating your own Visual Studio code snippets

<re-published from my old blog>  Some time back I got thinking… everytime I start reading mails in the C# discussion alias at my company or Eric Lippert’s explanations of why the supposedly peculiar behaviour is in fact logical… the first thing I do is open up my very extensively used “ExperimentalConsoleApplication” solution in Visual Studio, comment…