I'm thinking along the same lines for a data entry function for a module I'm writing. Each point can contain 2 required data elements, an optional name parameter, and an optional hash containing options for that point. Internally to the module, I'll be storing all this as a hash of hashes, but from an external standpoint, I can see many ways of allowing the data to be entered. These include:
Is such complicated distinguishing of a mutable argument a good thing for development? It's certainly not a problem to replace this mutable call with several functions that have more specific ways of accepting data, but that would seem to complicate the API of the module, requiring the user to remember exactly what is to be passed to each function. A function call with such a mutable argument begins to move the module usage to a state of "do what I mean, not what I say" in terms of user interaction, requiring them to remember less about the specifics of the API and focusing them on their own programming more.
Are there any options or ideas in regards to this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 1: Complexity of API argument passing
by tilly (Archbishop) on Jul 14, 2001 at 01:40 UTC | |
by Masem (Monsignor) on Jul 14, 2001 at 02:35 UTC | |
by tilly (Archbishop) on Jul 14, 2001 at 03:09 UTC | |
|
Re: Complexity of API argument passing
by TheoPetersen (Priest) on Jul 13, 2001 at 23:39 UTC | |
|
Re: Complexity of API argument passing
by voyager (Friar) on Jul 14, 2001 at 01:03 UTC | |
|
Re: Complexity of API argument passing
by jepri (Parson) on Jul 14, 2001 at 16:07 UTC | |
|
Re: Complexity of API argument passing
by pmas (Hermit) on Jul 16, 2001 at 19:56 UTC |