Comment on Classes often aren't the simplest tool for the jobparentComments−fullstackchris4yBut many other languages are like this. AFAIK, C# is the same - there are no first class functions allowed, only classes.−thomasz4yIn practice, the difference is pretty small in C#. For almost all purposes classes act like a namespace (System.Math), and can be imported like one. Former 6 will add even more syntactic sugar, so that methods can be defined outside classes.−stickfigure4yYou can import static methods in Java too. Works the same.−DeathArrow4yIn C# I either use classes as namespaces or use them as data structures. Using and static keywords help a lot.I write lots of C# but I try to use as little of OOP as possible.
Comments
But many other languages are like this. AFAIK, C# is the same - there are no first class functions allowed, only classes.
In practice, the difference is pretty small in C#. For almost all purposes classes act like a namespace (System.Math), and can be imported like one. Former 6 will add even more syntactic sugar, so that methods can be defined outside classes.
You can import static methods in Java too. Works the same.
In C# I either use classes as namespaces or use them as data structures. Using and static keywords help a lot.
I write lots of C# but I try to use as little of OOP as possible.