作为一个有用的副作用,它还能为我们带来代码的单元测试和说明文档。
As a useful side-effect, it also provides us with unit testing and documentation of our code.
此代码还举例说明了指定回调的参数的一种方法:作为一个匿名列表,具有到作为第一个 参数的回调的引用,随后是所需的参数。
This code also demonstrates one way to specify arguments to a callback: as an anonymous list, with a reference to the callback invoked as the first element, followed by the required parameters.
这对于跟非开发人员解释软件的运行来说非常之有用,同时也可作为针对后来者或者代码修改人员的一份很有价值的文档说明。
This can be valuable in explaining the software to non-developers or it could be useful documentation for when a software design needs to be learned by others and modified later.
应用推荐