Sunday, June 22, 2008

These are a few of my favorite things...

Every adventurer has to have tools to survive. These are a few of my favorite shortcuts within the IDE that help me code faster.

These shortcuts all work in C#. I am not certain of the VB.NET equivalent.

Tab Tab = Insert Snippet - Get Bill McCarthy's the nice Snippet Editor here

F12 = Go To Definition - Thanks to Jim Zimmerman for teaching me to use this to navigate to CSS style definitions within ASPX control markup.

F8 = Go To Next Task/Error List Item

Ctrl+. = Show the list of context sensitive actions (e.g. Generate Method Stub, Import Namespace, Refactor...). In the screenshot below you see the familiar little red bar under the "S" in "SaveChanges()". Whenever you see that little red bar you can type Ctrl+. and a list of options will appear. Generally, there is just one option so you can type Ctrl+.+Enter and you will have implemented whatever suggestion VS has recommended. If you pair this tip with the F12 = "Go To Definition" tip you can quickly write code to invoke methods, generate the method stub and navigate to the method body. The great thing about the "Generate Method Stub" refactoring implementation is that it generally determines the correct return type as well as all of the parameter types and places the method in the correct class.

Customizing the ToolBar (More on this in anothe post to follow)

A great place to get daily tips is Sara Ford's Blog

I hope that 1 or all of these types can help provide you with more valuable tools in your coding adventures.

No comments: