T
Tobias Weber
Hi,
maths says that the value of expressions like x == y and y == x is
always equal. And indeed most programmers wouldn't think twice about
using x < y instead of y > x (except maybe those versed in machine
language...).
But direction does matter in ruby, where operators are just messages
sent to the left operand. This often bites me when using ===.
Have you had bugs fixable by rotating an expression?
maths says that the value of expressions like x == y and y == x is
always equal. And indeed most programmers wouldn't think twice about
using x < y instead of y > x (except maybe those versed in machine
language...).
But direction does matter in ruby, where operators are just messages
sent to the left operand. This often bites me when using ===.
Have you had bugs fixable by rotating an expression?