logo
CSharp_Prog_Guide

Допускающая наличие ошибок оптимизация

Оптимизация допускает наличие ошибок. Иными словами, можно выполнить оптимизацию проекта, построение которого выполнить невозможно. Однако в таких случаях процесс оптимизации может неправильно обновить неоднозначные ссылки.

Extract Method

Extract Method is a refactoring operation that provides an easy way to create a new method from a code fragment in an existing member.

Using Extract Method, you can create a new method by extracting a selection of code from inside the code block of an existing member. The new, extracted method contains the selected code, and the selected code in the existing member is replaced with a call to the new method. Turning a fragment of code into its own method lets you quickly and accurately reorganize code for better reuse and readability.

Extract Method has the following benefits:

When descriptive names are used, high-level methods can read more like a series of comments.