Explaining functional programming to object-oriented programmers and less technical people

后端 未结 12 1452
小蘑菇
小蘑菇 2021-01-30 23:09

What are some good examples that I can use to explain functional programming?

The audience would be people with little programming experience, or people who only have ob

12条回答
  •  遇见更好的自我
    2021-01-31 00:03

    It might be easier to describe functional programming by its fundamental characteristics first:

    1. Functions (obviously)
    2. There are no side effects
    3. Immutability
    4. Recursion is very important
    5. Very Parallelizable

    Of these, the most important characteristic is the notion of no side effects, as the other characteristics follow from that.

    Functional programming is used in places you might not expect. It is used to run traffic lights and communications switches (Ericsson switches run Erlang), for example.

提交回复
热议问题