- 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.
- 腫瘤免疫治療嚴(yán)重不良反應(yīng)案例分析
- 孕育優(yōu)質(zhì)寶寶的12堂成功課
- 世界衛(wèi)生組織成人和青少年癌痛藥物治療和放射治療管理指南
- 腫瘤內(nèi)科醫(yī)師查房手冊(cè)(第2版)
- 梅毒實(shí)驗(yàn)室診斷技術(shù)與質(zhì)量控制
- 臨床心理學(xué)
- 你的第一本抑郁自救指南
- 人感染禽流感防治知識(shí)問(wèn)答
- 常見(jiàn)惡性腫瘤治療原則與實(shí)施方案
- 我的自閉癥:發(fā)現(xiàn)自己的隱形天賦
- 學(xué)習(xí)睡覺(jué)
- 趙洪鈞醫(yī)學(xué)真?zhèn)?/a>
- 你好,我是阿斯伯格員工
- 圖解骨傷科痛癥治療手法
- 神經(jīng)病學(xué)(第2版)