Turn: iOS and functional programming

Source: Internet
Author: User

Functional programming in the function f (x) emphasizes the stateless, in fact, the emphasis is to lock the state inside the function, a function that does not depend on any external state, only depends on its entry parameter value, once the value is determined, the function returns the result is OK. Some people may feel that the entry is also the state, is the external incoming state, in fact, I said before the variable will have a state, the value is not state,

Functional programming in the function, can be summed up in a sentence: the isolation of all external states, incoming values, output values.

A pure function is a function that is emphasized by functional programming, and the above two points can be translated as:

  1. Not dependent on external state
  2. does not change the external state

So the understanding of functions in functional programming is finally carried out to the understanding of state. The state of stillness is safe, the state of change is dangerous, and the danger can be understood from two dimensions, time and space.

Turn: iOS and functional programming

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.