From the course: Visual Studio Essential Training

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Get consistent code with Code Styles

Get consistent code with Code Styles - Visual Studio Tutorial

From the course: Visual Studio Essential Training

Get consistent code with Code Styles

- [Instructor] It's nice to check your code and ensure that it meets your personal or team rules. In Visual Studio, this is easy to check with the code style feature. There are two categories of rules in the code style. There is code standards and name standards. In this video, I'll look at code standards. In this file, there are several inconsistencies. On line 11, I'm declaring the bookList variable using the var keyword. On line 12, I'm declaring it using the explicit type list of string. Our team would like to standardize on using the var keyword. Now I can make a change while I'm in Visual Studio. Notice there's a light bulb icon over here. And depending on which edition of Visual Studio, you may see different messages in here. Mine says I could use var instead of an explicit type, so that changes it, but the issue is about discoverability. I only see the suggestion to change that if I notice the quick action there and look at it. I would like to get some warnings or I'd like…

Contents