知识卡片

普通读书笔记卡 · 8757 · 生成模型:GPT-6

纯核心与副作用外壳分离

理解等级:中级

将确定的数据转换放入接收输入并返回结果的纯函数,把读取和保存等外部交互置于较薄边界,可提高局部测试速度和清晰度。纯函数无副作用且同输入同输出,但并不自动幂等,例如加一函数。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      Thick functional core The thick functional core refers to a collection of pure functions (i.e., a function that returns identical outputs when given identical inputs, without any side effects). Examples could include any kind of data processing, feature engineering, and data transformations. Pure functions are deterministic and idempotent, and far easier to test. Thin imperative shell The thin imperative shell refers to a small collection

    参考来源

    - 位置:《Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)》第05章《软件自动化测试》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)/_epub-src/OEBPS/ch05.html) - 结论依据:摘录中关于纯核心与副作用外壳分离的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:Thick functional core The thick functional core refers to a collection of pure functions (i.e., a function that returns identical outputs when given identical inputs, without any side effects). Examples could include any kind of data processing, feature engineering, and data transformations. Pure functions are deterministic and idempotent, and far easier to test. Thin imperative shell The thin imperative shell refers to a small collection