def method_name(arg1, arg2)
instead of def method_name arg1, arg2
especially when they do not like empty parentheses for no args def method_name()
and they just love to omit the parentheses when actually using a method puts "odd"
Why the inconsistency? Unnecessary parentheses are unnecessary! When in doubt .. let the args out!edit:
> Avoid hashes-as-optional-parameters. Does the method do too much?
And I'm totally against this. This is an extremely useful pattern and can be key to increasing readability. I basically insist on opts hashes on any method with more than 2 args. Wow, you can see what is intended rather than Model.do_something(3, false, false).
Any big application has methods that take a lot of switches. The opts hash pattern lets you at least label them, rather than rely on obscure argument order. And it lets you set defaults on the args in a sane way (rails' famous reverse_merge!). Why would anyone be against that?