Notes on ‘Refactoring ‘ — 2.1 Extract Method

When to do it?

  There is
a method that is too long, or some code in which
needs a comment to understand its purpose

Benefits

   1. Finely grained sub-methods may be
reusable in the future.

   2. More
readable. A series of sub-methods seem like a series of comments.

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.