Well, it qualifies as a question, but obviously the results are going to be the same either way so it's just a matter of style. (There are probably weird overload situations where it could make a difference, but you should avoid those to start with. I can come up with examples if you want, but it's probably not worth it.)
If you feel a particular need to emphasize that it's a static method, feel free to make it Routines.method1()
- but normally I'd just leave it as method1()
.
EDIT: I've tried to come up with an example where it makes a difference using overloading with params
:
void CallMethod()
{
Console.WriteLine("Calling Method()");
Method();
Console.WriteLine("Calling Test.Method()");
Test.Method();
}
void Method(params string[] ignored)
{
Console.WriteLine (" Instance method called");
}
static void Method()
{
Console.WriteLine (" Static method called");
}
This calls the static method in both cases though. (Interestingly, putting the params
on the static method gives a slightly confusing error message using the MS C# compiler, and blows up the Mono compiler completely - at least the version I'm using.)
With a parameter, you could get into odd situations with generic type parameters and type inference, but not without any parameters. Even so, the non-generic form would take precedence.
In short, I don't think I can do it after all :(