3 ms·
But many other languages are like this. AFAIK, C# is the same - there are no first class functions allowed, only classes.
by fullstackchris 5y ago
But many other languages are like this. AFAIK, C# is the same - there are no first class functions allowed, only classes.
- thomasz 5y agoIn 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.
- stickfigure 5y agoYou can import static methods in Java too. Works the same.
- DeathArrow 5y agoIn 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.