Front-end Code refactoring

Source: Internet
Author: User

Read someone else's code refactoring experience Feel good, special reprint, and so on their own experience after to add.

http://www.sxt.cn/u/4647/blog/5584

Briefly, code refactoring roughly includes the following:

  1. CSS,JS is modular and is placed as much as possible in the same file to reduce the number of requests
  2. Simplified and unified external framework with repetitive functions
  3. Improve page load performance by adjusting resource loading order, using compressed resources, or Sprite graphs
  4. Code style refinement normalization, such as naming style and indentation

However, it is necessary to anticipate risks during the refactoring process to avoid introducing more difficult bugs to detect. and develop the habit of testing each part of the change, and record performance-related parameters for each test to facilitate later analysis.

As for the performance test, this article summarizes well.

Front-end Code refactoring

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.