Code of the Marrow-fifth chapter-function

Source: Internet
Author: User

Function: Easy to understand and reuse

The advantages of small program functions do not come out, the code is very few cases, it is easy to grasp the function of each line.

The program is becoming larger and bigger, not easy to grasp the global , in addition, may use very similar operations many times.

After the number of rows, the code of a certain number of lines as a whole and name it, this is the function.

The code blocks that need to be executed repeatedly are encapsulated into functions, which are called repeatedly , making the source code compact and clear.

Encapsulate the same operation (that is, a function)

(1) To make the procedure shorter;

(2) Avoid repeating code that allows the reader to read the same content repeatedly;

(3) Make the procedure easier to understand.

Code of the Marrow-fifth chapter-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.