in reply to API design - if you're expecting a scalar and an array ....
I'd say XML::Writer got it wrong and should have used a hash reference rather than a flattened list. Note that Perl Best Practices, page 182, advises you to pass a hash ref, not a list of name/value pairs, and so allow you to catch some errors at compile time, rather than run time. This point, along with many others related to API design, is dicussed in detail in On Interfaces and APIs.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: API design - if you're expecting a scalar and an array ....
by Porculus (Hermit) on May 23, 2009 at 23:32 UTC |