In an effort to adapt Ruby to the idiosyncrasies of people, Ruby has developed a number of idiosyncrasies of its own. For example, I’m not entirely sure if anyone actually knows Ruby’s grammar; and if so, I wonder their motivation for subtlety like this:
~> irb
? p ([1] + [3]).join(",")
"1,3"
? p([1] + [3]).join(",")
[1, 3]
NoMethodError: undefined method `join' for nil:NilClass
from (irb):31
?
It’s not exactly simple, though remember Matz said, “I’m trying to make Ruby natural, not simple.” Then the question is whether or not its natural. I guess that depends entirely on one’s nature.
Commentary