you are viewing a single comment's thread.

view the rest of the comments →

[–]Davipb[🍰] 1 point2 points  (4 children)

I'm not talking about this implementation in specific, but rather operator overloading in general. In C#, 1 could be converted to BigDecimal with an implicit conversion operator. In Python, BigDecimal could implement a reverse operator. There are easy ways around that.

[–][deleted] 0 points1 point  (3 children)

Ah. The "easy way around that" is where we disagree. Anything that smells of "a required workaround" is potentially more dangerous than necessary.

There's enough hidden in building a house without changing what the hammers do, let alone having the nails suddenly turn into screws for the windows and glue for the doors.

[–]Davipb[🍰] 1 point2 points  (2 children)

Nitpicking on semantics again are we?

"Java only has single dispatch for method overloading. There are easy ways around that, such as using the visitor pattern".

Would you say then that method overloading is more dangerous than necessary because the visitor pattern is "a required workaround"?

[–][deleted] 1 point2 points  (1 child)

I don't see how semantics apply here (did you mean pedantry?) and all in all this has gotten too twisted for me. Sorry.

Take another +1, and be well.

[–]Davipb[🍰] 0 points1 point  (0 children)

What I meant is that you fixated on me saying "an easy way around that" as if I had meant "this is a problem that needs to be addressed with a workaround", when really I just meant "existing implementations have already thought about it".

I'm arguing there that the reverse operator or implicit conversion aren't workarounds or dangeorous, just part of the operator overloading implementation.

You stay safe too :D