When possible.. do you leave parentheses in or out in Ruby?
相关问题
- How to specify memcache server to Rack::Session::M
- Why am I getting a “C compiler cannot create execu
- reference to a method?
- ruby 1.9 wrong file encoding on windows
- gem cleanup shows error: Unable to uninstall bundl
相关文章
- Ruby using wrong version of openssl
- Difference between Thread#run and Thread#wakeup?
- how to call a active record named scope with a str
- “No explicit conversion of Symbol into String” for
- Segmentation fault with ruby 2.0.0p247 leading to
- How to detect if an element exists in Watir
- uninitialized constant Mysql2::Client::SECURE_CONN
- ruby - simplify string multiply concatenation
From the Elements of Ruby Style
Whichever is more readable usually.
But I always use parentheses when I'm nesting function calls inside other ones' parameters
If you've been programming for a long time, you'll probably have an "itch" to add parentheses, and in many cases there are good reasons for this.
The code is easier on the eyes though in my opinion, and I haven't run into a problem yet--if you're going to need parentheses, you'll know it beforehand before you have to run into the debugging script.