12
© BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

© BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

Embed Size (px)

Citation preview

Page 1: © BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

© BJSS Limited 2005 Commercial in Confidence

Visual Studio 2008 Productivity Enhancing Tips and ResourcesJeff Watkins – 25 September 2008

Page 2: © BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

© BJSS Limited 2005 Commercial in Confidence

What Problems are Being Addressed?

Traditionally in IDEs, especially Visual Studio• Developers spend too much time writing boilerplate code and

documentation• Searching and navigating through complex projects is

cumbersome time consuming• Tasks such as testing and refactoring are poorly represented

The aim is to address all of the points above to allow the developer to spend more time actually writing the business logic

Page 3: © BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

© BJSS Limited 2005 Commercial in Confidence

Types of Productivity Enhancement

These cover several areas• Environment Setup• Environment and Language Usage• Integrated Tools• Additional Free Tools• Additional Paid For Tools• Resources, where to go next

Page 4: © BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

© BJSS Limited 2005 Commercial in Confidence

Environment Setup

Set up directories, indentation etc. before starting a project.

State other preferences, such as:• Open HTML pages in Source View• Track the current file in Solution Explorer• Change the Start page or get rid of it• Change the default font-size to a smaller size so you can see more code. • Turn off animations

Keep your projects clean, place test packages in a separate project to the main code.

Page 5: © BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

© BJSS Limited 2005 Commercial in Confidence

Environment and Language Usage

Learn key bindings• Useful items like auto comment and block select get overlooked• See Microsoft Visual Studio 2008 key binding reference poster• Create your own bindings to custom macros

Use bookmarks and splitter panes to quickly refer to different parts of code at once

Optimise compilation options to save time

Regular expressions can be used in find/replace• Useful for larger searches

Use Code Snippets to aid code reuse• These are kept for you by the IDE for insertion into the code as

and when the developer sees fit

Page 6: © BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

© BJSS Limited 2005 Commercial in Confidence

Environment and Language Usage #2

Automatic properties• New feature for .NET 3.5, saves a lot of boilerplate code being

written

Conditional Breakpoints• Right click the breakpoint and add an expression to evaluate

The task list• Mark your code with TODO and HACK comments and they will

appear on the task list

Page 7: © BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

© BJSS Limited 2005 Commercial in Confidence

Integrated Tools

The Refactoring tool, use where possible to• Rename• Encapsulate• Inherit• Extract Interfaces

Testing• Testing Tools, run tests and capture code coverage

automatically. Keeps an archive of test run results.• Automated Test Generation

Creates correctly named file and sample tests based on exposed properties and methods etc.

Code Analysis• Points out unmaintainable pieces of code

Page 8: © BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

© BJSS Limited 2005 Commercial in Confidence

Additional Tools (Free)

Free tools and Addins (get automatically added to your Visual Studio menus)• Installers available in shared directory• These have been cherry-picked from lists of the highest rated tools

StyleCop• Microsoft implementation• Allows customisable style rules• Quick and simple way to pick up coding style problems• Installer available on shared drive

FXCop• Profiles built assembly, looks more at the access rules, interfaces etc.• Quick and easy way to pick out potentially vulnerable code

Page 9: © BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

© BJSS Limited 2005 Commercial in Confidence

Additional Tools (Free) #2 GhostDoc

• Allows you to document code automatically• Needs some extra flower-boxing around the comments to make it HboS compliant

but otherwise does a good job

PowerCommands• Various mini tools for making navigation in Visual Studio easier

Reopen closed files Collapse all projects in solution Extract constant from pasted text etc.

ProfileSharp• Does a rudimentary job of profiling console applications, services and websites• Allows you to see what methods are taking up the most CPU time and or memory• Nowhere near as stable or as friendly as dotTrace (which is not free)

Page 10: © BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

© BJSS Limited 2005 Commercial in Confidence

Additional Tools (Paid For)

Resharper• Powerful set of tools for .NET, mainly C# based (hence the

name) but also available for VB.• Includes code analysis, cleanup, refactoring and generation tools

that are more richly featured than the Microsoft equivalents.• Free 30 day trial available, full license isn't prohibitively expensive

(280 Euros).

dotTrace• The most useful tool of all (in the author’s opinion). • A simple way to dramatically improve application performance by

identifying the methods which are taking the greatest amount of time and or memory.

• Licensing the same as Resharper.

Page 11: © BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

© BJSS Limited 2005 Commercial in Confidence

Online Resources

Dot Net Tip of the Day (http://dotnettipoftheday.org)

MSDN Code Gallery (http://code.msdn.microsoft.com)

Visual Studio Gallery (http://www.visualstudiogallery.com)

Got Code Snippets? (http://www.gotcodesnippets.net)

Page 12: © BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008

© BJSS Limited 2005 Commercial in Confidence

Questions?