Comparing two identical operands in a binary operator can be a mistake. If two identical operands are used in a binary operator, the result is always predictable and will always be true. This can lead to unintended consequences if the code is meant to compare two different variables.
let x = 10
let y = 5
if x == x {
print("x is equal to x")
}
let x = 10
let y = 5
if x == y {
print("x is equal to y")
}