Refactoring C# Code in Whidbey
Want to refactor some code? How do we do it today, maybe use global find and replace? Ugly.
Whidbey has several great new tools to select a block of code, right click and select one of about 8 ways to refactor your code. My personal favorite is “Extract Method” where Whidbey takes selected code and makes it a new method (complete with parameters). Whidbey then writes a line of code where the code use to exist calling your new method.
Some other refactoring tools allow you to promote a variable to a parameter, switch the order, etc of parameters and also “surround with” which allows you to surround your code in an If statement, Try block, etc.
(From TLS321: Visual C# "Whidbey" IDE Enhancements)
Page rendered at Monday, August 8, 2022 7:04:23 PM (Eastern Daylight Time, UTC-04:00)
The opinions expressed herein are my own personal opinions and do not represent
my employer's view in anyway.