Andrey Tarantsov

2个Pod
理由,简单三点
* Algorithmic / data structure-heavy code (e.g. “create an empty array with the given capacity, iterate over the input collection, perform a test on each element, add the elements passing the test to the output array”)
* API-heavy code (e.g. “get a file manager, ask for the properties of the given resources, check for errors”)
* Domain logic (e.g. “ignore missing files”)
混合这些类型的代码在同一方法中是一个坏主意。
因此,当你发现自己正在同一个方法中写多个处理集合的代码行和多个API交互/应用逻辑代码行时,你应该将算法部分提取到单独的辅助方法中。
ATExpressiveCollections是从我多年的应用中提取出来的一组算法辅助工具。
许可协议:MIT