Posts

What are delegates in .Net and why do we need them?

There are few good books which cover everything about delegate and how they work but one thing which was missing in all of them was why do we need delegates and how the concept of delegates has originated. In this article I will try to cover this. For the internal working of delegates you can refer to these books: CLR via C# by Jeffery Richter C# in Depth by Jon Skeet The programming world consists of states and operations. State is the state of an object. An object consists of member fields which holds the state of the object. For example an object of class Employee will have members as Name, DateOfBirth, Project, Department etc. These members together hold the state of an employee object. An action is an operation which when done on an object moves it from one state to another. For example ChangeProject operation on an employee assigns a new project to the employee thus moving the state of the employee object from one to another. In programming languages these operatio...

Visual Studio Shortcuts

It may sound a little overemphasizing but shortcut keys save time, the millisecond of time that it takes to move our hands, from the keyboard to the mouse, actually adds up over the day. Using shortcuts is the key to working efficiently in our programming environment. Visual Studio has excellent support for utilizing the keyboard.  Here are a few standard shortcuts that can boost our productivity: 1. Inserting code snippet   S nippets are a useful feature in the Visual Studio IDE. With them, you can type a few letters and then press tab twice to insert a code fragment. For example to insert a constructor you type ctor and press tab twice. A related feature is "Surround With" for which keyboard shortcut is Cntrl+K+S. Here is the complete list of all code snippe t: https://msrmicrosoft.com/en-us/library/z41h7fat.aspx 2. Remove unused using: Keyboard shortcut is Shift + F10+ O+R         Some of the advantages of removing...