On Tuesday 25 November 2003 00:18, Tanaka Akira wrote:
> > 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.
>
> How it confuse you and REXML user?

The "secret" keys aren't clearly defined in the API.  IE, you don't have a 
clear list of what the arguments are.  Beyond that, it just seems like a 
perpetual point of confusion; like I said, I get a lot of questions about the 
magic arguments in REXML.  I can't really qualify it, because I don't 
understand why it is such a perplexing situation; if I did, I wouldn't have 
used them in the first place.

The code block that deals with the hashes seems to give be debugging problems, 
too, although I don't know if it gives me more problems than anything else.

> > 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.
>
> Is the problem dispatching code?

Which problem do you mean?  From the developer's point of view, or from the 
Ruby interpreter's point of view?

--- SER