Skip to content

Comment on Classes often aren't the simplest tool for the jobparent

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.