Why does Visual Studio by default create a private static method when refactoring code and selecting extract method?
If I’m refactoring a non-static class and the method is only visible within the class why is it static?
Is there some performance benefit by calling a private static method within a non-static class compared to a non-static method within a non-static class?
Is it for readability to simply show that the method does not rely on any member variables of the class?
It does this only if your method doesn’t access any member variables/methods/properties. This is good because it basically operates on the principle of least assumptions: since you don’t access instance-specific data, might as well make the method
static.Theoretically, there might be but I doubt it. However, making the method static makes it clear that it will not access or modify instance data, which I find a useful hint.