Preprocessing and logical separation-code preprocessing

Source: Internet
Author: User

when Code is processed, we often find that many codes are similar and different. How can we find similarities and differences?
pre-processing first combines the parts that process the same logic code.
applicable environment:
1. when a Program is started, data must be processed in advance for display, the code for processing the data is very similar to the code generated by the user's operations on the interface. Merging two sections of code is imperative. Therefore, we need to distinguish different logics in the Code and perform preprocessing.
2. query with different conditions usually has a lot of code that is consistent.
example:
query: The number of work hours must be confirmed by Pl. Two confirmation functions are available. One is to confirm the selected row, one is to confirm all rows, confirm that a row of data is the same logic, and confirm which row of data is different logic. Therefore, we need to separate the data into a function.

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.