Conclusion This chapter provided you with some hands-on experience with refactoring and explained how you can develop your code using the test-code-refactor cycle. I strongly recommend reading Refactoring by Martin Fowler; though the examples are in Java, don't let that scare you from seeing how they would apply to C#.If you are the only one on your team doing refactoring, it will be hard at first, but don't try to force others to see the wisdom of your ways; instead, let them learn by seeing the results you produce. If they think you are wasting your time, that is fine, too. Many people think I am wasting my time going to the gym three days a week or getting up early for a run on the beach. I know I am doing some good for myself and for the good of my team, and that is enough. They will see that the code that has been refactored has more flexibility and is easier to work with. Your code will be fitter than code that has not been refactored.  |