My Favourite Techniques

By Haemoglobin
3/22/2011 (revision 18)

Visual Studio 2010

  • If needing to find exactly where an exception is being raised: Debug -> Exceptions -> Tick Common Language Runtime Exception when Thrown.
  • Ctrl-Tab - Switch between open files.
  • Ctrl-Alt-Q - Quick Watch
  • F10(step over), F11(step into),F12(goto definition)
  • Ctl-Shift-F to search over all files for any directory (and file contents with regex) can be useful even for non-programming tasks.
  • Ctl-i - Incremental Search (F3, Shift-F3 move next/last)
  • Ctl-Alt-Down - Open list of open files.
  • Ctl-minus/Ctl-shift-minus - navigate back/forward.
  • Architect Explorer, Pinned DataTips and Consume First Development
  • Ctrl-. - Popup "using context menu" when object has red underline.
  • Tools -> Extensions Manager -> Online Gallery
    • Install Regex Editor, PowerCommands, Productivity Power Tools, VS10x Code Map, XAML Intellisense Presenter, Go to definition (ctl-click)
  • Debug.WriteLine to write information to the console especially useful for certain types of debugging.
  • Hold down alt and drag mouse for vertical selection, typing will change entire column.

Extensions

Tools -> Extension Manager

  • Productivity Power Tools
  • Power Commands
  • VS10x Code Map
  • VS Commands 2010

T-SQL

  • sp_helptext [Table/SP]

C#

  • String.Format("String {0} {1}", param1, param2); instead of "+" string concatination.
  • String.IsNullOrEmpty(str)
  • Try to create methods as light weight as possible (fewer lines of code). This not only helps with readability but also helps debug null reference exceptions.
  • IEnumerable squares = Enumerable.Range(1, 10).Select(x => x * x);
  • Enumerable.Empty()

Testing

  • Clear method name
    • MethodUnderTest_Input_ExpectedOutput
    • BDD Style
    • One assert or mock per test method (forces naming of test to be clear stops subsequent asserts from not running).

Web Development

FileZilla

  • Making use of the Directory Comparison and Synchronised Browsing can be useful for deploying changes to a website.
  • Use the SVN/CVS file filter to avoid deploying source control files.

FireBug

Configuration Management

Take advantage of appropriate DNS entries for service names, ie:

  • clientdb.prod.example.com for Production
  • clientdb.perf.example.com for Performance Testing
  • clientdb.qa.example.com for QA
  • clientdb.dev.example.com for Development

Refactoring


Comments

Powered by BlogEngine.NET 1.6.1.0 | Design by styleshout | Enhanced by GravityCube.net | 1.4.5 Changes by zembian.com | Adapted by HamishGraham.NET
(c) 2010 Hamish Graham. Banner Image (c) Chris Gin