Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

43.1. REFACTORING CODE

It's been recounted many times, but it's worth repeating: The faster your code downloads, the faster your application feels to the user. You don't have control over your users' connection speed, but you do have control over how big your code files are. The size of your code files depends on a variety of factors, but two things that often add to code size are code duplication and unnecessary statements.

43.1.1. Refactoring Duplicate Code

You can cut the size of your code by refactoring duplicated code. When you refactor your code, you improve it without changing its external behavior. The most common means of refactoring code is identifying duplicated code and modifying it to be reused and easily maintained.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint