> This is relevant in the context of OOP because in OOP when you talk of methods, you talk of single-dispatching, polymorphism and the Liskov substitution principle.
Which also apply to Smalltalk.
> Static methods are just plain functions tied to classes from an era when people thought having classes everywhere is actually a good idea,
Using GNU Smalltalk serialization syntax,
Object subclass: #MyClass.
MyClass class extend [
myClassMethod [
^ 'Hello from class method'
]
]
Transcript show: MyClass myClassMethod.
Using Java as example, I see no difference from
class MyClass {
public static string myClassMethod () {
return "Hello from class method";
}
}
System.out.println(MyClass.myClassMethod());
> Btw, if you're wondering from where the convention of using static methods for operators comes from, that's another relic of C++, a language not known for elegance, finesse or for being a good OOP language.
Better know C++, before bashing it.
In C++ operators can be defined as member functions and participate in inheritance resolution except for operator=.
I guess you are mixing C++ with C#.