VISUAL ASSIST - Filling Gaps in Visual Studio for C/C++ and C# Developers

Tips and Tricks

12 Helpful Tips For Visual Studio Productivity

Visual Studio provides a lot of useful tools to help programmers greatly simplify the software development process. In this article, we will learn 12 helpful tips for increasing Visual Studio productivity that you may not know about, but that will be very useful for you.

#1 Navigation through the elements of the project

In a large project, there are a lot of classes and methods, which greatly complicate the process of finding the right place in the code for you. Visual Studio provides special features to simplify the work with such projects.

To search for class members, you can use the Class Navigation menu located in the upper right corner of Visual Studio. When you click on the triangle button in this menu, a drop-down list appears with a list of all members of the class. When you click on a specific member, you navigate to it in the code.

To navigate through code elements, you can also use the Go to All feature. It allows you to find the desired element and filter the type of elements to search.

Go to All feature searches code elements through the entire project.

#2 Navigation through definitions and implementations

If you want to look at the definition of a member implemented in some class, then this is easy enough to do. You just need to select the Go to implementation command in the context menu that opens when you right-click on the selected member. You can also use the F12 hotkey.

In some situations, it is helpful to go to some implementation of a class member. To do this, select the command Go to implementation or use the hotkeys CTRL+F12.

Another useful feature that improves Visual Studio productivity is the possibility to find all references for the selected class member. It is easy to do using the Find All References command or Shift+F12 hotkeys. After executing the command, a search results window will open with a list of all references. By clicking on the selected reference, you will be redirected to it in the code. Find out more about setting up Visual Assist.

#3 Browsing the Structure of the Code

With Solution Explorer, you can view the overall structure of your code. It contains information about classes, their types, and members. If you select a code element in Solution Explorer, the associated file opens and the cursor moves to the selected element in the file.

You can also browse the hierarchy of method calls, search for symbols and symbol references, and so on.

#4 Code Editor Split For Productivity

You can split the code editor vertically or horizontally. This is very useful if you need to edit code in several related files at the same time. Also, vertical groups of documents improve Visual Studio productivity on very wide screens. You can easily move files between different groups of documents.

#5 Quick Search In Visual Studio

In Visual Studio, there is a search text box in the menu bar. You can use it for searching menu commands, dialog boxes, files, types, members, and more. To do this, just enter the keywords you want to find.

Also, it is possible to filter the content of tool windows. A lot of tool windows have a search bar that you can use to find the items you need.

In the Error List window, you can use the filter to display errors only in the files currently opened in the editor, errors only in the current file, or errors only in the current project.

#6 Conditional Debugging

In Visual Studio, you can add conditions to breakpoints. In this case, the break in the debug process occurs only if the specified condition is met. This can be especially useful when debugging loops that have a large number of elements and you only want to examine the element that matches the specified criteria.

#7 View objects that are out of scope

When debugging applications, in the Watch window, objects are tracked by their reference names. When such a reference goes out of scope, its value in the Watch window becomes unavailable, even if the object pointed to by the reference is still active.

Visual Studio provides the ability to continue tracking the state of an object outside of the scope. To do this, you need to create an object ID. Then, when the reference goes out of scope, this ID can be used to observe the state of the object.

#8 Code Snippets Increase Productivity

An important tool for increasing Visual Studio productivity is the ability to insert code snippets into your project. Using this feature, you can automatically insert frequently used pieces of code, which significantly speeds up the process of writing code.

There are a lot of ready snippets in Visual Studio. For example, snippets for creating a constructor, properties, loops, conditional operations, etc. If you often use the same piece of code in your project, then you can create your own snippet.

#9 Extract methods and interfaces

Visual Studio provides the ability to automatically perform various actions that otherwise would take a long time if you were performing them manually.

You can generate a new method from the selected part of the code using the quick action Extract method. A method will be created with all the required parameters and the code you chose. All that’s left for you to do is enter the method name.

It is also easy to create interfaces from existing classes. Just click the quick action Extract interface near the class name and select the class members you want to extract to the interface.

#10 Work with images in web applications

Visual Studio greatly simplifies working with images when developing web applications. You can drag and drop images from Solution Explorer into HTML code. In this case, the code is generated automatically. You can encode the image to base64 automatically, as well as automatically insert image height and width attributes.

#11 Shortcuts

Visual Studio has a huge list of keyboard shortcuts that allow you to perform various actions from code navigation to code generation, refactoring, debugging, and more. Using keyboard shortcuts is the best way to improve Visual Studio productivity and speed up the coding process.

#12 Extensions

If you are missing the standard tools that Visual Studio offers, you can install extensions. There are a lot of extensions available for Visual Studio that can be easily installed and customized to suit your needs.

One of them is Visual Assist, which simplifies the process of navigating through code, writing, and debugging code, and also allows you to customize code highlighting in a way that suits you.

Ready to get started boosting your Visual Studio productivity?

In this article, we learned a lot of interesting features that improve Visual Studio productivity. Want 10 more reasons? We are confident that when using them, you will write code much faster and easier.

Head over and download the latest version of Visual Assist!

Related posts
Tips and Tricks

Do I Need To Know C++ For Unreal Engine?

Tips and Tricks

The Most Pervasive Problems In Game Development

Tips and Tricks

13 Things About Visual Assist For Visual Studio 2022 You May Not Have Known

Build Announcements

Visual Assist 2022.2 is here

%d bloggers like this: