If an object is never created, it is not single. There are no instances of an object, not just one instance.
There is nothing wrong with that, but what's the use?
EDIT
It seems to me that a real comparison occurs between a class that has only class methods and global functions.
In this comparison, the advantage that I see is the spacing between the names. When you create class methods, you must qualify function calls with the class name, so you can say
SomeClass.someMethod()
or
SomeOtherClass.someMethod()
These are two different functions, and it is obvious that they are different functions.
With global features you just talk
someMethod()
If in the future you generate code for another user who also has the global function someMethod() , you will get a compiler error about the duplicate function and must solve it.
source share