News for hackers. Stuff that matters.
Re:Lies we tell ourselves to keep using Golang by AnimalMuppet on Friday April 29, 2022 @01:00PM (#31207708)
== should do the obvious thing. But with operator overloading, it's not clear that it does, unless you need to read the implementation of == very carefully.
Re:Lies we tell ourselves to keep using Golang by delta64 on Saturday April 30, 2022 @09:13AM (#31215837)
How is that any different to some opaque method call? By the same logic `a.equals(b)` might be doing something funky under the hood
Re:Lies we tell ourselves to keep using Golang by AnimalMuppet on Saturday April 30, 2022 @12:51PM (#31217333)
True. But people think about it a bit differently. People don't always expect == to be a function call.
Re:Lies we tell ourselves to keep using Golang by delta64 on Saturday April 30, 2022 @04:03PM (#31218802)
Sure, but I think '== might be a function call' is a lot less confusing than '== sometimes compares for equal value and sometimes doesn't'