Python supports several functional programming concepts. The presentations shows how to use functional features such as functions as first-class objects, closures, side-effect-fee functions, currying, lazy evaluation, no mutable data structures and use of iterators instead of loops. The focus is on integration of these concepts in existing programs.
Functional programming has been becoming more popular over the last few years. The often heard prejudice that this program paradigm is of mere academic interest has become much weaker. Haskell, Erlang and F# are commonly used functional languages that are applied in real-life applications.
Python supports several programming paradigms. In addition to the procedural and object oriented paradigms it also features import functional programming concepts. The presentations shows how to use functional features such as functions as first-class objects, closures, side-effect-fee functions, currying, lazy evaluation, no mutable data structures and use of iterators instead of loops. Examples help to demonstrate advantages and disadvantages for different types of tasks.
The structure of a program in functional style can be considerably different than that of an object printed program. Example show how to incorporate functional elements step-by-step into object oriented programs. The presentations shows how the itertools module of the standard library supports late evaluation. The functions of this module enable the programmer to write short, well-readable and efficient code for a variety of use cases. It also integrates very well in non-functional program parts.
Each first-level bullet point corresponds to one idea and is typically one slide. Some might get two or three smaller/less dense slides.
The theoretical part is reduced to a minimum to give enough context. Listeners are assumed to have a basic understanding of functional programming. So the theory is just a very quick recap. Focus is on examples with source code. These code examples are often simplified to focus on the principles.
Each first-level bullet point corresponds to one idea and is typically one slide. Some might get two or three smaller/less dense slides.
The theoretical part is reduced to a minimum to give enough context. Listeners are assumed to have a basic understanding of functional programming. So the theory is just a very quick recap. Focus is on examples with source code. These code examples are often simplified to focus on the principles.
Introduction
Advantages of Functional Programming
Disadvantages of Functional Programming
Functional Features in Python - Overview
Example: Pure Functions
Example: Functions as Objects
Example: Closures and Currying
Example: Immutable Data Types
Example: Lazy Evaluation - Generators
Functional but not Pure
Example: Avoid Side Effects
Example: Freeze a Class
Example: Pipelining
Itertools - Lazy Programmers are Good Programmers
Conclusion