Hi,

  In mail "Re: Proposed patch to add SSL support to net/pop.rb"
    Eivind Eklund <eivind / FreeBSD.org> wrote:

> > I think that #start has taken too many parameters.
> 
> Apropos: Nobody has mentioned the use of named parameters yet.  That
> would give something like the following (for 1.8 - in 2.0, we have extra
> syntactic sugar):

1.  Matz has already discouraged use of ":name => value"
style arguments.  So you must explicitly write it as:

  Net::POP3.start(...., {:certs => c, :verify => v})

Note that "a: value, b: value" syntax is not portable.
Ruby 1.8 has not implemented it.

2.  If you use a hash argument for :certs and :verify,
you also want to pass other arguments in the same way  e.g.

  Net::POP3.start({:host => 'mail.example.com', :port => 110,
                   :user => 'aamine', :password => 'abcdefgh',
                   :apop => true,
                   :ssl => true, :certs => c, :verify => v})

But it is too late.  The only way is checking the class of
the first argument, that is a bad design.

3.  Keyword arguments should not be used to hide the bad
design (too many parameters).


Regards,
Minero Aoki