ZILtoid1991@lemmy.world to Programmer Humor@programming.dev · 2 months agoAccidental shitpostlemmy.worldimagemessage-square18linkfedilinkarrow-up1155arrow-down16
arrow-up1149arrow-down1imageAccidental shitpostlemmy.worldZILtoid1991@lemmy.world to Programmer Humor@programming.dev · 2 months agomessage-square18linkfedilink
minus-squareflamingo_pinyata@sopuli.xyzlinkfedilinkarrow-up22·2 months agoYou’re using Java, there’s your problem
minus-squareKairos@lemmy.todaylinkfedilinkarrow-up8arrow-down2·2 months agoThis syntax isn’t actually a problem by itself. Go does this too (no operator overloading)
minus-squareGremour@lemmy.worldlinkfedilinkarrow-up4arrow-down1·edit-22 months 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·2 months agoI think you can also == two structs in Java, but not classes.
You’re using Java, there’s your problem
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.