- Hands-On Reactive Programming with Python
- Romain Picard
- 256字
- 2021-06-24 18:25:22
Summary
This chapter introduced some semantics of functional programming and how they apply these to Python code. This is by no means a complete guide to functional programming, but it covers everything that is needed to start out with functional programming: lambdas, closures, side effects, pure functions, and higher-order functions.
You should now have all the key elements to start writing functional and reactive applications. Hopefully, just like the many JavaScript developers using it today, you will find the architecture proposed in this chapter elegant, easy to use once you have the correct mindset, and scalable (in term of code size).
The application of this architecture on the echo server showed you how to solve real-life challenges, such as observable cycles. Moreover, by keeping the application logic pure, it becomes easy to add new features by implementing new components and using them through composition. Another benefit of this architecture that was not detailed here, however, is that testing the application logic is easy since it is pure. Many difficulties in unit testing come from side effects that are not present in this code. A typical benefit of testing a pure function is that you never need mocks, but just provide input arguments and check the return value.
The next chapter will cover in detail how observables and observers work. It will explain the different ways to create observables, how to subscribe to them, and how to unsubscribe from them. It will also explain the different types of observables, which has not been discussed yet.
- 操作系統實用教程(Linux版)
- Kubernetes修煉手冊
- Linux網絡管理與配置(第2版)
- 零起點學Linux系統管理
- 深入Linux內核架構與底層原理(第2版)
- Instant Optimizing Embedded Systems using Busybox
- 嵌入式實時操作系統μC/OS原理與實踐
- VMware NSX Cookbook
- 完美應用RHEL 8
- Distributed Computing with Go
- Linux內核API完全參考手冊(第2版)
- 嵌入式微系統
- Learn Quantum Computing with Python and IBM Quantum Experience
- VMware vSphere 5.1 Cookbook
- 大規模Linux集群架構最佳實踐:如何管理上千臺服務器