不必更换语言,也能隔离副作用
函数式是否主流的演讲把语言流行与无突变风格区分开;Boundaries 在 Ruby 中用值驱动的核心处理决策、命令外壳承接 I/O,提供无需先改语言的具体做法。
沿同一来源继续阅读
对照原文
no language features are required to program this stylethe expired users class makes all the decisions and the sweeper class has all the dependencies.Ruby 不会自动禁止突变;该设计靠边界纪律,且外壳仍保留必要副作用。