News for hackers. Stuff that matters.
Re:I Love Ruby by sinkwool on Monday December 18, 2023 @09:04PM (#38690940)
`and`, `or`, `not` have much lower precedence than `&&`, `||` and `!` . I would just avoid `and` and `or` in general.

For some more explanation see https://graceful.dev/courses/the-freebies/modules/ruby-langu...

Re:I Love Ruby by djur on Tuesday December 19, 2023 @01:38AM (#38692573)
Rubocop forbids the use of `and` and `or` in a value expression for this reason, and I believe several style guides used with Rubocop ban them entirely. I like them but have come to accept that they're more trouble than they're worth (in a shared codebase with lots of contributors, at least).