Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web.
|
2005-12-22 What I really want is error-shielding interfacesRecently (for my version of 'recently'), the blogosphere had a little tiff about 'humane' versus 'minimalist' APIs, starting with Martin Fowler's article and continuing onwards (there's a roundup here). To caricature the positions, the minimalist side feels that APIs should have only the basic building blocks, and the humane side feels that APIs should have all of the commonly used operations. (Part of the fun of the whole exchange is that it got framed as a Ruby versus Java issue, due to the examples picked.) I come down somewhere in between, because I am nervous about the large APIs that humane design creates but I think that minimalist APIs offload too much work to the programmer. What I like is APIs with basic building blocks and routines to do the common operations that are easy to get wrong. Unfortunately I have no snappier name for this approach than 'error-shielding interfaces'. For example, getting the last element of a list. Something like
' Similarly, I think that Python's In Python, there's another reason to add common operations to
extension module APIs: an extension module can often implement a
common operation significantly more efficiently than Python code
can. For example, the Python equivalent of (There's also Ian Bicking's contribution, more or less on interface design in general here, which is well worth reading and thinking about.) (One comment.)
python/OnInterfaceStyles written at 02:56:53; Add Comment
|
These are my WanderingThoughts GettingAround This is part of CSpace, and is written by ChrisSiebenmann. * * * Atom feeds are available; see the bottom of most pages. Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web |