What I said was that if the compiler doesn't throw an error, that doesn't mean that the code is correct and works how you want it to.
I believe a compiler should not compile code that it can determine to be incorrect, or likely to be incorrect.
That entirely depends on your definition of "correct".
You're getting off the main point, which is that for *any* type, a compiler cannot infer what 'is greater than', or 'is less than' means, and if the compiler cannot infer what that means and the type is not based on an intrinsic type for which the compiler *can* infer a meaning, the compiler should not compile code that uses > or < on a type that does not provide overloads for them.
A compiler for example, doesn't know what a 3d vector is, so it can't generate code that returns a bool indicating if one 3d vector 'is greater than' another.
It's just that plain and simple.
I'm not getting off the point, you were telling me that == is a valid way in OOP languages to compare two strings for equality of value. That is fundamentally incorrect. You also said that if an operator doesn't cause the compiler to bug out, it's valid to be used (and in fact SHOULD be used) in that case. Also incorrect.
Sorry, I don't want to get into it with nit-pickers with nothing better to do than mince words to try to find flaws in them.
In most
well-designed OOP programming languages, both of those assertions are true. Java isn't a well-designed programming language, in my opinion.
Since there are many "oop languages", some obscure, half-baked, and rarely used, One can also say that there is nothing at all that *all* of them have in common, nor is there any rule or principle that every one of them supports, which means, that you're not really saying much of anything by asserting that what I've said about operators is not true for "*any*" oop language.
It is true for most well-designed ones.
So, what you're up to here is making an issue out of my use of one word: "any" as in "any oop language".
Well sorry, I'm not interesting in feeding cheap, opportunistic, pot-shots based on relatively meaningless minutae and nit-picking of words.