- Hands-On Reactive Programming with Clojure
- Konrad Szydlo Leonardo Borges
- 201字
- 2021-07-02 14:03:57
Identifying problems with our current approach
Aside from the lines of code responsible for building the user interface, our program is roughly 48 lines long.
The core of the program resides in the share-price and avg functions, which are responsible for querying the price service and calculating the average of a list of n numbers, respectively. They represent only six lines of code. There is a lot of incidental complexity in this small program.
Incidental complexity is complexity that's caused by code that is not essential to the problem at hand. In this example, we have two sources of such complexity: the thread pool and the rolling buffer function (we are disregarding UI-specific code for this discussion). They add a great deal of cognitive load to someone reading and maintaining the code.
The thread pool is external to our problem. It is only concerned with the semantics of how to run tasks asynchronously. The rolling buffer function specifies a detailed implementation of a queue and how to use it to represent the concept.
Ideally, we should be able to abstract over these details and focus on the core of our problem; Compositional Event Systems (CES) allow us to do just that.
- Learning Ansible 2.7(Third Edition)
- 床旁超聲監(jiān)測(cè)
- 口腔科常見及多發(fā)病就醫(yī)指南系列:口腔正畸就醫(yī)指南
- 顧嘉雄 張良圣醫(yī)案精華
- 皮膚美容激光治療原理與技術(shù)
- 實(shí)用皮膚病性病圖譜
- 人感染禽流感防治知識(shí)問(wèn)答
- 拯救孩子視力(第三版)
- 身體關(guān)節(jié)功能篩查及糾正
- 針灸學(xué)基本概念術(shù)語(yǔ)通典(上下冊(cè))
- 乳腺癌患者自我管理手冊(cè)
- 化妝品生產(chǎn)質(zhì)量管理規(guī)范240問(wèn)
- 深井效應(yīng)
- 白內(nèi)障超聲乳化手術(shù)培訓(xùn)教程
- 神經(jīng)病學(xué)(第2版)