ShakaCode | ShakaCode Blog | Rails On Maui Blog | Rails | ReactJs | JavaScript | Webpack | Productivity |

Why use parens for method calls and ternaries?


Prefer parens for ternaries and method calls in Ruby. Required for a ternary in a method call as hash value.


  1. You don’t need parens for method calls.
  2. You don’t need the {} for passing a hash
  3. You can have some subtle bugs when you throw a ternary operation in the mix!