Static vs. non-static method
c#, performance
Solution
Note that it is highly unlikely the compiler is even allowed to make that change on your behalf since it changes the signature of the method. As a result, some carefully crafted reflection (if you were using any) could stop working, and the compiler really cannot tell if this is the case.
Problem
Suppose you have some method that could be made static, inside a non-static class. For example: ``` private double power(double a, double b) { return (Math.Pow(a, b)); } ``` Do you see any benefit from changing the method signature into static? In the example above: ``` private static double power(double a, double b) { return (Math.Pow(a, b)); } ``` Even if there is some performance or memory gain, wouldn't the compiler do it as a simple optimization in compile time? Edit: What I am looking for are the benefits by declaring the method as static. I know that this is the common practice. I would like to understand the logic behind it. And of course, this method is just an example to clarify my intention.