of Vector3D at runtime? you lose type safety if java fails to make it work somehow at runtime
how does .equals handle it then
at compile time or with an catchable exception other than Runtime ones
then simple, don't let == compile with different types as well, what's the issue with that
so you're admitting that java fucked up and it should have allowed you to overload operators?
What language did you make?
You made it?
it's a meme (i think it's a pretty good one) but i did
Jesus, overloading operators? What sodomy is coming next?
https://kotlinlang.org/docs/operator-overloading.html
This sucks. That's dirty, that's inadequate. This shouldn't be legal.
yeah you're right. it's dirty. i should be doing obj1.isLessThanOrEqualTo(obj2) instead of obj1 <= obj2
Because that creates a new contract. Operators must work unambiguously. The code becomes shady. Also, I have to admit in some cases that would be an appreciated tool (BigInteger in java). However, I've heard enough scarestories about people abusing it in c++.
abusing is on the developer being bound by not being able to do something is on the language I'd rather have a more expressive language
This is about likes & dislikes now tbh. I'd rather not give monkes grenades.
I'd rather not hire monkeys
no you compareTo Comparable<T> objects then you have an int to work with using operators designed for numbers
so you want me to use a mechanism that C used 50 years ago
Обсуждают сегодня