ZILtoid1991@lemmy.world to Programmer Humor@programming.dev · 1 day agoAccidental shitpostlemmy.worldimagemessage-square17fedilinkarrow-up1142arrow-down16
arrow-up1136arrow-down1imageAccidental shitpostlemmy.worldZILtoid1991@lemmy.world to Programmer Humor@programming.dev · 1 day agomessage-square17fedilink
minus-squareKairos@lemmy.todaylinkfedilinkarrow-up7arrow-down2·1 day agoThis syntax isn’t actually a problem by itself. Go does this too (no operator overloading)
minus-squareGremour@lemmy.worldlinkfedilinkarrow-up4arrow-down1·edit-222 hours agoIn Go you can compare structure instances with == (by value). You can also compare pointers (in which case they can be different even if values are equal). You get what you ask for. Also, I’ve never needed “Equals” method in Go.
minus-squareKairos@lemmy.todaylinkfedilinkarrow-up5·20 hours agoI think you can also == two structs in Java, but not classes.
This syntax isn’t actually a problem by itself. Go does this too (no operator overloading)
In Go you can compare structure instances with == (by value). You can also compare pointers (in which case they can be different even if values are equal). You get what you ask for.
Also, I’ve never needed “Equals” method in Go.
I think you can also == two structs in Java, but not classes.