Book Image

Refactoring with Microsoft Visual Studio 2010

By : Peter Ritchie
Book Image

Refactoring with Microsoft Visual Studio 2010

By: Peter Ritchie

Overview of this book

Changes to design are an everyday task for many people involved in a software project. Refactoring recognizes this reality and systematizes the distinct process of modifying design and structure without affecting the external behavior of the system. As you consider the benefits of refactoring, you will need this complete guide to steer you through the process of refactoring your code for optimum results.This book will show you how to make your code base more maintainable by detailing various refactorings. Visual Studio includes some basic refactorings that can be used independently or in conjunction to make complex refactorings easier and more approachable. This book will discuss large-scale code management, which typically calls for refactoring. To do this, we will use enterprise editions of Visual Studio, which incorporate features like Application Performance Explorer and Visual Studio Analyzer. These features make it simple to handle code and prove helpful for refactoring quickly.This book introduces you to improving a software system's design through refactoring. It begins with simple refactoring and works its way through complex refactoring. You will learn how to change the design of your software system and how to prioritize refactorings—including how to use various Visual Studio features to focus and prioritize design changes. The book also covers how to ensure quality in the light of seemingly drastic changes to a software system. You will also be able to apply standard established principles and patterns as part of the refactoring effort with the help of this book. You will be able to support your evolving code base by refactoring architectural behavior. As an end result, you will have an adaptable system with improved code readability, maintainability, and navigability.
Table of Contents (17 chapters)
Refactoring with Microsoft Visual Studio 2010
Credits
About the Author
Acknowledgement
About the Reviewers
Preface
6
Improving Class Quality
9
Improving Architectural Behavior

KISS principle


KISS, "Keep It Simple Stupid" (or the less pejorative "Keep It Short and Simple") is a principle that suggests favoring simplicity over complexity. Simple code is easier to read and consume.

There are many code smells that deal with detecting complexity and refactoring it to simpler code. These smells deal with specific areas of complexity such as class-level complexities, method-level complexities, and so on. Simplicity can apply in many other places.

Computer language syntax has a subset that deals with a more general context and sometimes a subset that deals with more specific contexts. C# is no exception. There have been additions to the language for specific scenarios. Lambdas, for example, are a means towards functional programming that promote side-effect-free programming and avoid having to specify the details of the algorithm. Lambdas are a key part of the LINQ story. While you can use LINQ without lambdas, it's hard to avoid lambdas with complex LINQ statements.

Lambdas...