Perl Monk, Perl Meditation | |
PerlMonks |
Re^3: RFC: Tool::Boxby tmoertel (Chaplain) |
on Nov 23, 2004 at 01:49 UTC ( [id://409779]=note: print w/replies, xml ) | Need Help?? |
In order for a library to be useful, programmers must understand it. A
chimera-like interface that shifts depending on the number of arguments
passed to a function or upon magic use-time flags only places hurdles
on the track to understanding. I'm squarely with diotalevi: The
interface should be clear and unchanging.
I recommend having separate functions for each behavior. For example, we could use the _acc suffix to denote accumulating functions that can be used to accumulate results iteratively. As long as we are clear and consistent in our usage, we can deliver both accumulating and non-accumulating functionality without making the library harder to understand. One possible implementation:
Cheers, Tom Moertel : Blog / Talks / CPAN / LectroTest / PXSL / Coffee / Movie Rating Decoder
In Section
Meditations
|
|