ReSharper complains when method can be static, but isn't

前端 未结 8 1363
萌比男神i
萌比男神i 2020-11-28 08:43

Why does ReSharper complain when a method can become static, but is not?

Is it because only one instance of a static method is created (on the type) and thus save on

8条回答
  •  爱一瞬间的悲伤
    2020-11-28 08:58

    Very good debate on that subject here (SO). I am in the camp of if-it-can-be-made-static-make-it-static. I believe this because of the notion of why one would have an instance method that does not use any instance data. Is it truly an instance method in that case or is it actually a class method?

提交回复
热议问题