[Python-Dev] Replacement for print in Python 3.0

Chris Smith smitty_one_each at bigfoot.com
Tue Sep 6 22:53:15 CEST 2005


>>>>> "Guido" == Guido van Rossum <guido at python.org> writes:


    Guido> <intermezzo>

    Guido> In a different thread I mentioned a design principle for
    Guido> which I have no catchy name, but which has often helped me
    Guido> design better APIs. One way to state it is to say that
    Guido> instead of a single "swiss-army-knife" function with
    Guido> various options that choose different behavior variants,
    Guido> it's better to have different dedicated functions for each
    Guido> of the major functionality types. So let's call it the
    Guido> "Swiss Army Knife (...Not)" API design pattern.


I call the idea the 80/20 Split, or 'Convenience Functions'.
You have a powerful, highly generalized function that can do most
anything, and has an interface to prove it.
Then, a collection of 'Convenience Functions' to constrain that "Swiss
Army Knife" to handle 80% of the use-cases, while still letting Ye
Power User dig a little deeper.
The challenge is to keep the Convenience Function population low, so
that you don't arrive at 8,020 different functions in the interface.
Go, Python!
Chris



More information about the Python-Dev mailing list