Code reconstruction rules

Source: Internet
Author: User

The following is my personal summary of code refactoring based on the actual experience: refactoring purpose: the purpose of refactoring is to allow the code to be understood and understood by others without comments. Reconstruction principles: 1. remove duplicate code 2. if you do not understand a method, divide it into a smaller part and give them an appropriate name 3. try to make your public processing methods and functions only do one thing. 4. public processing methods and functions are short and lean 5. easy-to-read/easy-to-understand code is better than code with better performance. Simple and easy-to-understand code is the final purpose. Reference article: refactoring rules-coding

Code reconstruction rules

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.