官术网_书友最值得收藏!

Understanding Functional Programming

Functional programming defines a computation using expressions and evaluation; often these are encapsulated in function definitions. It de-emphasizes or avoids the complexity of state change and mutable objects. This tends to create programs that are more succinct and expressive. In this chapter, we'll introduce some of the techniques that characterize functional programming. We'll identify some of the ways to map these features to Python. Finally, we'll also address some ways in which the benefits of functional programming accrue when we use these design patterns to build Python applications.

Python has numerous functional programming features. It is not a purely a functional programming language. It offers enough of the right kinds of features that it confers the benefits of functional programming. It also retains all the optimization power of an imperative programming language.

We'll also look at a problem domain that we'll use for many of the examples in this book. We'll try to stick closely to Exploratory Data Analysis (EDA) because its algorithms are often good examples of functional programming. Furthermore, the benefits of functional programming accrue rapidly in this problem domain.

Our goal is to establish some essential principles of functional programming. The more serious Python code will begin in Chapter 2, Introducing Some Functional Features.

We'll focus on Python 3.6 features in this book. However, some of the examples might also work in Python 2.
主站蜘蛛池模板: 施秉县| 肇东市| 临颍县| 什邡市| 湘西| 农安县| 中方县| 临高县| 陵水| 遂昌县| 文昌市| 黑水县| 永寿县| 外汇| 新民市| 云霄县| 蚌埠市| 来安县| 洞头县| 承德市| 阳春市| 开江县| 马尔康县| 琼结县| 广宁县| 青神县| 贵溪市| 东丽区| 桑日县| 安远县| 吴桥县| 民乐县| 菏泽市| 保定市| 凭祥市| 黔江区| 正镶白旗| 西乌珠穆沁旗| 清河县| 彝良县| 乐陵市|