Seeking philosophical guidance on library interface design.
alex at tweedly.net
Tue Apr 23 19:01:48 EDT 2019
I'm building a library (which I plan to release as Open Source), and I'm
having trouble trying to decide which approach to take with default values.
The library is to produce XY graphs (charts). An app which is using it
will provide one or more sets of data to be plotted. The app can also
*optionally* provide additional parameters, such as
- display tick-marks on each axis
- display grid lines along each axis
- label the ticks / grids (e.g. display label every 5 ticks)
Without going into each one of them, there is an overall "phlosophy" chioce
A - should the default be that the produced graph be simple (e.g. no
ticks, no labels, etc.)
B - should the default be to try to find reasonable / possible values
(e.g. set a value for ticks such that they appear, say, more than 10
pixels apart, but less than 100 pixels apart; that you label every
2nd-5th tick, ...)
A is appealing because it means that the library isn't making guesses,
often dumb guesses, on your behalf; you see a blank, sparse graph, and
can then, as app developer, provide additional parameters to supply info
you think will help. But it is unappealing because the graphs are just
*so* empty by default.
B is appealing because it feels like it is being helpful, and will (try
to) produce a reasonable looking graph as best it can.
So - I'd welcome any suggestions, comments, design philosophy ideas ?
More information about the Use-livecode