-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 04/26/2012 10:16 AM, Matt Wagner wrote:
On Thu, Apr 26, 2012 at 06:02:00PM +0200, Michal Fojtik wrote:
On 04/26/12, Maros Zatko wrote: I want to propose this: https://github.com/bbatsov/ruby-style-guide for the general discussion :-)
Yes! That's the resource I was thinking of.
This reminds me of one thing I've seen us do inconsistently -- parenthesis for arguments where they're not strictly required.
For example, I prefer: user.update_attribute(:foo, 'bar')
But this is also totally valid: user.update_attribute :foo, 'bar'
It seems that some people try to always use the parens, some try to never use them, and some (AFAICT) prefer to use them only when there is more than one argument. The linked style guide suggests using them when they are part of an internal DSL or considered "keywords" or accessor methods, but all other method invocations should use parens. I don't feel too strongly, except that consistency is nice.
-- Matt
Speaking as someone who has to read this code (and is not super familiar with it) I would greatly appreciate anything that results in consistency/making my life easier =).
- -- Kurt Seifried Red Hat Security Response Team (SRT) PGP: 0x5E267993 A90B F995 7350 148F 66BF 7554 160D 4553 5E26 7993