Google CodePro 规则
我已经使用 Google CodePro Audit for java 几天了,我很惊讶它对我改进代码的帮助。
有些规则我从未想过,有些规则我并不真正理解其后果。
例如,我一直认为使用实用方法是一个很好的做法。但其中有一条规则规定“除非在某些情况下,否则应避免使用实用方法”。谁能详细说明一下吗?
另外,请发表您的意见,其中使用 codePro 必须遵循的规则。
谢谢。 问候 布鲁诺
I have been using Google CodePro Audit for java for few days now and i'm amazed in how much it helped me improve my code.
There are some rules which never crossed my mind and some that i don't really understand the consequences.
For instance, i always though that using utility methods were a good pratice. But there is a rule in there which states "Utility methods should be avoided except under certain circumstances" . Can anyone elaborate on that ?
Also, post your opinions in which are the MUST rules to follow using codePro.
Thank You.
Regards
Bruno
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为发出警告的原因是实用方法剥夺了 Java 编程的面向对象本质。
然而,我认为我所从事的 Java 项目都至少有一个只包含
public static
方法的实用程序类。I think the reason for the warning is that utility methods take away from the Object Oriented nature of Java programming.
However, I don't think I've ever worked on a Java project that didn't have at least one utility class containing only
public static
methods.