导航

[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   淅沥枫  阅读(216)  评论(0编辑  收藏  举报

努力加载评论中...
点击右上角即可分享
微信分享提示