`
george.gu
  • 浏览: 71165 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Clean Code (1): Meaningful Method Signature

阅读更多

Remove useless method

Remove method never referenced

  1. If method or API is not used any more, it is better to remove them rather than keep them.
  2. Version control/management tools should/will keep old version for you.

Method naming shortly and easy to understood its propose

Attributes in signature should consistent

For example, some method could have attribute "String data", if there are different type of data: text string, byte array string, int value.... It is better to create dedicated method for specific data type or add a new attribute to identify data type. Otherwise, future maintenance could mix them by mistake.

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics