首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件开发 >

Clean Code (一): Meaningful Method Signature

2012-07-02 
Clean Code (1): Meaningful Method SignatureRemove useless methodRemove method never referencedIf me

Clean Code (1): Meaningful Method Signature
Remove useless methodRemove method never referenced

    If method or API is not used any more, it is better to remove them rather than keep them.Version control/management tools should/will keep old version for you.
Method naming shortly and easy to understood its proposeAttributes 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.

?

?

热点排行