导航

[notes] some code tips

genericizing-code

genericizing-code

原文链接: http://ericasadun.com/2015/07/31/genericizing-code/

Prefer functionality over implementation

 Focus your code on the connections between data creation and data consumption instead of the particulars of specific types.关注于数据创建和数据消费的关系

It’s never too late to refactor

Watch out for repeated code across different types

One protocol does not rule them all

Differentiate type constraints from parameter constraints

Conform at the highest possible level

Design with collections in mind

posted on 2015-08-06 01:16  淅沥枫  阅读(215)  评论(0编辑  收藏  举报