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 ответов

15 просмотров

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

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

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

а через ESC-код ?
Alexey Kulakov
29
30500 за редактор? )
Владимир
47
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
13
Недавно Google Project Zero нашёл багу в SQLite с помощью LLM, о чём достаточно было шумно в определённых интернетах, которые сопровождались рассказами, что скоро всех "ибешни...
Alex Sherbakov
5
program test; {$mode delphi} procedure proc(v: int32); overload; begin end; procedure proc(v: int64); overload; begin end; var x: uint64; begin proc(x); end. Уж не знаю...
notme
6
Как передать управляющий символ в открытую через CreateProcess консоль? Собсна, есть процедура: procedure TRedirectThread.WriteData(Data: OEMString); var Written: Cardinal;...
Serjone
5
вы делали что-то подобное и как? может есть либы готовые? увидел картинку нокода, где всё линиями соединено и стало интересно попробовать то же в ddl на lua сделать. решил с ч...
Victor
8
Ребят в СИ можно реализовать ООП?
Николай
33
Подскажите пожалуйста, как в CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); получить наз...
A Z
7
Карта сайта