Cofounded Host Collective (DiscountASP.net). Cofounded Player Axis (Social Gaming). Computer Scientist and Technology Evangelist with 20+ years of experience with JavaScript!
Cofounded Host Collective (DiscountASP.net). Cofounded Player Axis (Social Gaming). Computer Scientist and Technology Evangelist with 20+ years of experience with JavaScript!
This isn't completely accurate. C# has static classes and static functions that can achieve the same results.
You could even create a static class called
Global
and then call functions like:This would act the same as a global function, it would just be prefixed with a namespace or type.
I understand this, but I don't understand that reason why it was done. Why not allow functions at the namespace scope instead?
By overloading the functionality of a class it needlessly confuses its purpose.
C# was created at the peak of OOP mania. Other options weren't as popular. It's one of the reasons why I transitioned from C# to JavaScript.