5 ms·
Careful here: I've seen plenty of "Rubiomatic" bugs that look like this: value = function_that_nils or "default" ... which results in nil assignment to value.
by old-gregg 18y ago
Careful here: I've seen plenty of "Rubiomatic" bugs that look like this:
value = function_that_nils or "default"
... which results in nil assignment to value. Accidental confusion between || and 'or' is very common in Ruby world IMO, almost like famous == vs = in C.
- iamwil 18y agoAgreed. I think one is for statements (or) and the other one is for expressions (||), so they have different operational precedence, even though you could use them interchangeably, as long as you knew what got executed first.