Performance of using static methods vs instantiating the class containing the methods

后端 未结 8 1692
别跟我提以往
别跟我提以往 2020-11-30 07:31

I\'m working on a project in C#. The previous programmer didn\'t know object oriented programming, so most of the code is in huge files (we\'re talking around 4-5000 lines)

8条回答
  •  执笔经年
    2020-11-30 07:59

    I think you've partially answered this question in the way you asked it: are there any noticeable performance penalties in the code that you have?

    If the penalties aren't noticeable, you needn't necessarily do anything at all. (Though it goes without saying the codebase would benefit dramtically from a gradual refactor into a respectable OO model).

    I guess what I'm saying is, a performance problem is only a problem when you notice that it's a problem.

提交回复
热议问题