r/csharp • u/Zardotab • Feb 24 '21
Discussion Why "static"?
I'm puzzled about the philosophical value of the "static" keyword? Being static seems limiting and forcing an unnecessary dichotomy. It seems one should be able to call any method of any class without having to first instantiate an object, for example, as long as it doesn't reference any class-level variables.
Are there better or alternative ways to achieve whatever it is that static was intended to achieve? I'm not trying to trash C# here, but rather trying to understand why it is the way it is by poking and prodding the tradeoffs.
0
Upvotes
View all comments
Show parent comment
6
u/[deleted] Feb 24 '21
But the interface can change as often as you want either way, you just have to update your references (in either case). It's about what the language affords, not what it allows. It allows any changes you want, but that forces you to explicitly make changes to the method signature instead of the compiler making those changes for you.
It's really not a big deal.