- Hands-On Reactive Programming with Python
- Romain Picard
- 291字
- 2021-06-24 18:25:11
Reactive versus proactive
So what is reactive programming?
An easy way to get the idea behind it is to use an analogy with people's behavior: someone who is proactive is somebody who takes initiatives. A proactive person will propose ideas or test things before somebody asks him to do so. On the other hand, a reactive person is somebody who waits for information before doing something. So, a proactive person acts on his own while a reactive person reacts to external changes. There are pros and cons to each behavior: a proactive person proposing solutions ahead of time is great, but may have difficulties dealing with unexpected changes. On the other hand, a reactive person may be very efficient in dealing with very dynamic environments.
Reactive programming can be considered as implementing a behavior in a similar way to a reactive person. A reactive system reacts on external events and provides a result that depends only on the event it has received. So why would reactive programming be better than sequential programming? Better is always a matter of preferences and context, so reactive programming may not be the solution most adapted to all the problems you will encounter. However, as you will see through this book, reactive programming shines at implementing event-driven code.
Reactive programming is inherently asynchronous. So it makes it easier to deal efficiently with inputs and outputs than with synchronous paradigms. Reactive programming favors composition. Each component is completely independent from another and can be plugged in with other components. This also makes testing quite easy and, as a consequence, it also helps to refactor existing code. Moreover, it is quite engaging, and with experience you will see that almost everything is a flow of events.
- 電腦組裝與系統(tǒng)安裝
- Mastering vRealize Operations Manager(Second Edition)
- Designing Purpose:Built Drones for Ardupilot Pixhawk 2.1
- 白話區(qū)塊鏈
- 曝光:Linux企業(yè)運維實戰(zhàn)
- vSphere Virtual Machine Management
- 精解Windows8
- 混沌工程:復(fù)雜系統(tǒng)韌性實現(xiàn)之道
- Docker+Kubernetes應(yīng)用開發(fā)與快速上云
- Mobile First Design with HTML5 and CSS3
- Linux內(nèi)核觀測技術(shù)BPF
- 嵌入式系統(tǒng)及其應(yīng)用(第三版)
- Linux命令行大全(第2版)
- UI設(shè)計手繪表現(xiàn)從入門到精通
- Linux應(yīng)用大全 基礎(chǔ)與管理