On Monday 24 November 2003 14:28, Nathaniel Talbott wrote:
> What would you use in REXML if you had it to do over again? Will you
> eventually (for Ruby 2?) deprecate symbol keyed hash arguments in REXML,
> and move to something else?

I don't know, and yes.

"I don't know," because there isn't a good alternative to what I was trying to 
do.  I'd probably get rid of, or hide from the users, the constructor hash 
entirely, and force them to use methods.  I tell you, I've answered more 
questions about the proper use of those stupid argument hashes than any other 
single thing in REXML.  The thing is that it even confuses *me*, when I have 
to go back and deal with it.

"Yes," because I hate the idea of breaking the old API, but on the other hand, 
am dying to get ahold of named parameters.  REXML could really use named 
parameters, which is obvious if you look at any of the sourcecode for the 
nodal classes.

I do have to say that this is the singularly unfortunate thing about Ruby 1.x 
-- the lack of parametric method dispatching combined with the lack of named 
parameters is a really caustic combination[1].  What you end up doing, as a 
developer, is making these monolithic methods that take every possible 
argument, and contain a huge case statement that tries to make sense of the 
arguments.  It makes for really bad code, and it is unavoidable because 
there's no other solution in Ruby except to use hashed parameters, which are 
also problematic.  I'll be really happy when we get named parameters.

--- SER

[1] There is no possibility of parametric method dispatching in Ruby because 
of Ruby's loose typing.  Which is fine with me.  I'd rather live without 
overloading than have to use types.  When I want a strict programming 
language, I use Haskell, or Nice.