key 发表于 24-9-2009 11:03:22

The benefit of making your method static when possible

Message copied from our QQ talking group:

Syd-小key-Java(28845105)9:57:43 AM
Ok, guys. I really find the benefit of making methods static when possible.
Syd-小key-Java(28845105)9:58:17 AM
The benefit is: it will make your code looks ugly, very disgust!
Syd-小key-Java(28845105)9:59:46 AM
Yes, that's the benefit. And then, you'll find that you're not working on the OOP concept, although you suppose you're before you make them static. And then, you will feel obligated to change your design. So, that's the ultimate benefit.

So, try your best to make everything static, and find why they are static.

akai 发表于 24-9-2009 13:04:50

什么qq群啊. 还讨论英文?
牛b

周星星1832 发表于 24-9-2009 13:33:19

static
php 的 static 更是可笑呢

earthengine 发表于 24-9-2009 13:59:01

遍地static确实是不好的。不过,有时候static也确实很方便。比如Java/C#里面,main方法永远是static的。还有,在Monostate这个设计模式里的所有方法,以及Singleton里面,那个Instance方法,都是static的。

所以,最后还是一句,该用的时候坚决用,不该用的时候别用。
页: [1]
查看完整版本: The benefit of making your method static when possible