From: Avdi Grimm Date: 2007-04-12T22:29:32+09:00 Subject: Re: method signature - do I use named parameters OR pass a hash for flexibility/readability??? On 4/12/07, Greg Hauptmann wrote: > Option 1 - Named > - def this_method (time, search_string, something_else) > - a = this_method (11, "asdf", "asdf asdfa") > > Option 2 - Hash > - def this_method (params) > - a = this_method (:time => 11, :search_string => "asdf", :something_else > => "asdf asdfa") Don't forget option 3: a few required positional parameters followed by a hash of optional parameters. This is an approach used by Rails, and it's a nice compromise for methods with a lot of parameters. -- Avdi