Wednesday, May 13, 2009

Coading Tips

There are following tips for coding
use #region block
example:
#region regionName
//Do your work
#endregion
Declare all the variables at the top of constructor
example:
public class UClass
{
string globalString;
public UClass()
{
int a, b , c;
string str1, str2;
}

string s; //Avoid to declare variable here

public string retVal(string s)
{
return s;
}
}

Short cuts for Visual Studio

File Operations
  1. NewProject: [CTRL + SHIFT + N]
  2. OpenProject: [CTRL + SHIFT + O]
  3. AddClass: [SHIFT + ALT + C]
  4. AddExisting-Item: [SHIFT + ALT + A]
  5. AddNewItem: [CTRL + SHIFT + A]
  6. OpenFile: [CTRL + O]

Debugging
  1. Autos: [CTRL + D, A]
  2. QuickWatch: [CTRL + D, Q]
  3. Start With Degug: [F5]
  4. Start Without Debug: [CTRL + F5]
  5. StepInto: [F11]
  6. StepOut: [SHIFT + F11]
  7. StepOver: [F10]
  8. Stop Debug: [SHIFT F5]
  9. BreakPoint: [F9]
  10. Remove BreakPoint: [CTRL + SHIFT + F9]
  11. Watch: [CTRL + D, W]

Build
  1. Start: [F6 or CTRL + SHIFT + B]
  2. Cancel Build: [CTRL + Break]