First, let me agree that in Java, and C#, a class with static methods is the correct approach.
What I lament is that the language forces you to do this. They have packages/namespaces which should be used for this purpose. A class is meant to represent an instantiable type, if you have only statics in it it violates this definition. That is, I'm complaining the languages are creating confusion as to what a "class" is.
I understand that you see this as a problem, conceptually. In practice in Java, you could statically import the class and use the methods like functions. In that case, the class would ask more like a namespace than a „true“ OOP class.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
First, let me agree that in Java, and C#, a class with static methods is the correct approach.
What I lament is that the language forces you to do this. They have packages/namespaces which should be used for this purpose. A class is meant to represent an instantiable type, if you have only statics in it it violates this definition. That is, I'm complaining the languages are creating confusion as to what a "class" is.
Ah I see. The
Utils
pattern really does fly in the face of OOP, doesn't it?Yes.
I understand that you see this as a problem, conceptually. In practice in Java, you could statically import the class and use the methods like functions. In that case, the class would ask more like a namespace than a „true“ OOP class.