169 похожих чатов

That makes sense but what if you get an instance

of Vector3D at runtime? you lose type safety if java fails to make it work somehow at runtime

19 ответов

4 просмотра

how does .equals handle it then

Nader-Jafari Автор вопроса
drunktimelord
how does .equals handle it then

at compile time or with an catchable exception other than Runtime ones

Nader Jafari
at compile time or with an catchable exception oth...

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?

You made it?

Ulven - Old account
You made it?

it's a meme (i think it's a pretty good one) but i did

drunktimelord
so you're admitting that java fucked up and it sho...

Jesus, overloading operators? What sodomy is coming next?

Пользователь 61024
https://kotlinlang.org/docs/operator-overloading.h...

This sucks. That's dirty, that's inadequate. This shouldn't be legal.

Naz Klymok
This sucks. That's dirty, that's inadequate. This...

yeah you're right. it's dirty. i should be doing obj1.isLessThanOrEqualTo(obj2) instead of obj1 <= obj2

Пользователь 61024
Why?

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++.

Naz Klymok
Because that creates a new contract. Operators mus...

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

drunktimelord
abusing is on the developer being bound by not bei...

This is about likes & dislikes now tbh. I'd rather not give monkes grenades.

Nader-Jafari Автор вопроса
drunktimelord
yeah you're right. it's dirty. i should be doing ...

no you compareTo Comparable<T> objects then you have an int to work with using operators designed for numbers

Nader Jafari
no you compareTo Comparable<T> objects then you ha...

so you want me to use a mechanism that C used 50 years ago

Похожие вопросы

Обсуждают сегодня

читать файл максимально быстро? странный вопрос))
zamtmn
53
тоесть, указав return eax, сгенерируется никому ненужная инструкция mov eax,eax ?
Aiwan \ (•◡•) / _bot
24
Приветствуем всех! Устали без проектов? Если вы программист и хотите получать стабильные заказы, компания Elif предлагает вам недельный курс по поиску проектов и их ведению. ...
Elif
1
А чего сейчас в моде вместо Error для эксепшенов? А то я тут внезапно узрел что он не рекомендуется :) У Try::Tiny какой-то совершенно ужасный синтаксис если надо конкретные э...
Denis F
19
а зачем этот вопрос для удаления из чата?
Mёdkinson Medvezhkin
63
Привет. Сразу скажу, что на C/C++/Rust я не пишу, но тем не менее возникла потребность дебага C/C++/Rust кода. Суть: есть серверное приложение, которое периодически ведёт себ...
ninekeem 🐳
4
всем привет! углубившись в плюсы и начав изучать реверсинг понял, что без асм'а никуда со своими высокоабстрактными представлениями начал изучать механизмы асма, и не совсем п...
9
Всем привет, после Си стоит учить плюсы или лучше на раст перейти?
Linus
8
или вы считаете муит дает знание?
супер_лох_3000 альфа версия
12
значить например он учился в СДУ то получается он особенный?)
Asets Serikov
11
Карта сайта