Summary

This chapter showed how the refactoring tools built in to the Visual Studio code editor can greatly increase productivity and decrease unwanted side effects (bugs) when you’re making sweeping changes to your code to improve maintenance, reuse, and readability. The refactoring tools don’t simply make changes using text searches and replacements; they use the Visual Studio compiler to make and validate the code changes, and this improves confidence in, and reliability of, the tools.

These tools can be accessed using the keyboard (Ctrl+.), the Quick Actions menu (via a right-click), the class designer, and elsewhere. The refactoring tools enable you to change your code in many ways. You can easily rename items in your code. You can take existing lines of code and extract them to new methods. Your objects can be used as the basis to define new interfaces. You can modify method signatures, including removing and reordering parameters. Finally, you can take existing fields and quickly encapsulate them into properties.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset