This is notes from the Bringing Functional Programming into an Imperative World talk from DjangoCon 2017 – Derik Pell @gignosko on Github with demonstration repository at https://github.com/gignosko/DjangoCon_2017
Functional Programming is expressive, efficient, easier to work between concurrent/parallel programming (using more and more cores rather than faster processors), and increases safety in code if done well.
You can fake an immutable data structure using deepcopy… but it takes some extra time.
Recursion takes the place of loops in many functional languages
You can mimic functional programming with list comprehensions and lambdas
filter
[x for x in list_l if x % 2 == 0]
map
[(lambda x: x*x)(x) for x in list_1]
FP can be less verbose, more efficient, and more intuitive
BUT! can be slower, recursion can blow the stack up, functional code looks weird