Functional Programming in Python

Functional Programming in Python
Functional Programming in Python
English | MP4 | AVC 1920×1080 | AAC 48KHz 2ch | 2h 34m | 603 MB

Use Functional Programming as a powerful tool to solve many real-world problems by writing robust, testable, and bug-free code

Functional programming is a style of programming that is characterized by short functions, lack of statements, and little reliance on variables. You will learn what functional programming is, and how you can apply functional programming in Python.

In this video course, we will learn what functional programming is, and how it differs from other programming styles, such as procedural and object-oriented programming. We will also learn why and when functional programming is useful, and why and when it makes programs unnecessarily complex. Then we go on to explore lambda expressions, which are short one-line functions, and are the purest form of functional programming that Python offers. Next, we will learn about higher-order functions: functions that accept other functions as argument, or return other functions as return values. In Python, higher-order functions are elegantly supported through decorators. We will also encounter important concepts from functional programming, such as monads, currying, statelessness, side-effects, memoization, and referential transparency; these concepts may initially seem odd to Python programmers, but we will see how they are elegantly supported by the language. In fact, many Python programmers already make use of concepts from functional programming without being aware of doing so.

All the videos in this course contain hands-on examples of the introduced concepts. We will also consider several different implementations of an interactive calculator to illustrate how you can use functional programming in a simple-but-complete program.

What You Will Learn

  • Recognize the value of Functional Programming
  • Understand the advantages and disadvantages of Functional Programming
  • Higher-order functions and Lambda expressions (nameless functions)
  • Error handling in Functional Programming
  • Understand common functional design patterns, and how these apply to Python
Table of Contents

01 The Course Overview
02 Example – A Functional, Interactive Calculator
03 Pro – Stateless, Referentially Transparent Functions Produce the Same Result
04 Pro – You Can Prove That Code Is Correct at Least in Theory
05 Con – Complexity and Overly Deep Recursion
06 Con – Functional Programming Can Be Unintuitive
07 The Difference Between Statements and Expressions
08 Diving into Lambda Expressions
09 Understanding ‘and’ and ‘or’
10 Diving into Inline ‘if’ Expressions
11 Passing a Function as an Argument to Another Function
12 Nesting a Function in Another Function
13 Returning a Function from Another Function
14 The Operator Module – Operators as Regular Functions
15 Decorators – The @ Prefix
16 Decorators with Arguments
17 Currying – One Argument per Function
18 Monads – Variables That Decide How They Should Be Treated
19 Memoization – Remembering Results
20 You Cannot Catch Exceptions in Lambda Expressions
21 Handling Errors in Lambda Expressions
22 Example – A Fully Functional, Interactive Calculator