2 ms·
The real cause of the Ruby problem in the article is the automatic conversion of "1" to "true". This is a language design bug, and has nothing to do with assoc
by gnosis 17y ago
The real cause of the Ruby problem in the article is the automatic conversion of "1" to "true". This is a language design bug, and has nothing to do with associativity.
As for associativity proper, I program in multiple languages all the time, but find remembering the various associativity rule differences in these languages a pain in the ass. So I always use parenthesis.
That way anyone reading my code (including myself a few months later) will find it easy to understand what I intended, and the right thing gets done no matter what the associativity rules are.