Re:Ruby on WebAssembly
by dragonwriter on Sunday April 29, 2018 @01:58PM
(#16953091)
So, your first two complaints are you not understanding Ruby operator precedence, not Ruby logic being broken, and the other is you not understanding Ruby truthiness (null and false are not truthy, all other builtin/stdlib values [and conventionally all other values] are falsely.)
Re:Ruby on WebAssembly
by heartbreak on Sunday April 29, 2018 @02:05PM
(#16953124)
And the final complaint was about Rails, not Ruby.
Re:Ruby on WebAssembly
by abhorrence on Sunday April 29, 2018 @01:48PM
(#16953035)
and/or/not have different precedence than &&/||/!.
The symbol versions of each of those would behave as you would expect. However, I can’t say much in favor of the existence of the word forms.
The word forms are not operators, they're control flow, like "if"
Here’s when you’d use them
http://www.virtuouscode.com/2014/08/26/how-to-use-rubys-engl...
Hasn't the use of "and" been considered a bad practice for years?
``` puts true and not true >>> true x = true and false >>> true if 0; puts 'true';end ```
breaking backwards compatibility with every rails upgrade didn't help.
Similar bad behaviour in kotlin