Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>To be really safe with automated refactorings is very hard.</strong> </p> <p>When we first introduced refactorings in Visual C#, we asked ourselves this question: do our refactorings need to get things completely right all the time, or should we allow them to make mistakes in certain cases?</p> <p>To be right all the time would require a lot of programmer effort, meaning we'd only get a few refactorings in the box. It would also make the refactorings slow, as they'd spend a lot of time in validation.</p> <p>Allowing them to make mistakes would make them useless for any teams that didn't have great automated test coverage. TDD teams have good tests, but that's only one portion of the Visual Studio user base. We didn't want to make features that we had to tell people not to use!</p> <p>TDD teams would catch mistakes quickly, but they would learn just as quickly not to trust our refactoring tools. They'd hesitate to use them, and seek other solutions much of the time (find-and-replace instead of Rename).</p> <p>Also, as the C# team, we were in a good position to make high-fidelity refactorings. We had a unique advantage, with the C# language designers and compiler team just down the hall. We knew we should play to our strengths.</p> <p>So, we decided to make fewer high-quality refactorings, instead of lots of refactorings that weren't as reliable. Today there are 6. </p> <p><img src="https://i.stack.imgur.com/uf6uY.png" alt="Visual Studio Refactorings"></p> <p>Looking back, I wish we had only done Rename, Extract Method, and Introduce Local Variable. Those last two are almost the same, implementation-wise. The 3 Parameter refactorings (there used to be a 7th, Promote Local Variable to Parameter, but it was cut in VS2010) were a ton of work to get right, and probably weren't worth it.</p> <p>My recommendation is to <strong>do TDD</strong>, giving you a great collection of tests so you can refactor safely, whether you use a tool or do it by hand.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload