4 ms·
I don't believe you will ever get functions outside of classes in C#. It is antithetical to the entire ethos of the environment.
by Digit-Al 7y ago
I don't believe you will ever get functions outside of classes in C#. It is antithetical to the entire ethos of the environment.
- gameswithgo 7y agoyou can just make a public static class FUNCTIONS and then use a static use at the top of each file, then pretend.
- rafaelvasco 7y agoThank god we won't. Functions outside classes never did make sense to me. People love to hate classes sometimes. For me, everything starts at classes and structs;
- gameswithgo 7y agoin C# you can make a static class, and then put functions in it. When you do this, the class is nothing more than a namespace. But the class is already in a namespace. So you now have a redundant namespace. It isn't a big deal but its a bit silly to have to do that, when writing static functions.
- rafaelvasco 7y agoYeah I agree. I really like static classes, but I've seen them being overused; As long as it doesn't causes performance problems I'm good with it. In fact calling static methods is faster;