Which is better? private static vs private
- by KiD0M4N
In this code sample:
public class SuperMan {
private static bool IsProper(decimal x) {
return x > 31.0m && x < 45.0m;
}
public bool CheckStuff(string a, string b, string c) {
// lots of code, some of which introduces a variable x
return IsProper(x) && /* other conditions */;
}
}
Should IsProper(..) be a 'private static' or a 'private'. Assuming:
IsProper(..) doesn't need to access any instance state.