From: Søren H. <so...@ha...> - 2012-09-05 14:34:06
|
On Sep 5, 2012, at 4:09 PM, Nicholas Musolino wrote: > (a) Do users prefer function inputs with the (..."keyword", value) style, or the traditional ordered list of values? I don't think there are hard rules here. I tend to use "keyword", value for optional parameters and the ordered list for the "standard" parameters. > (b) Should all functions validate user-supplied inputs? For example, if two vectors need to be the same length, should the package code check that, or just try adding them and let the user see the Octave error? I think you should always validate input as it can be really hard to figure out what the true cause of an error message is. Also, in the case of directional statistics, you can get non-sense results without generating errors for non-unit input. > (c) In the cases of other errors, e.g. a function can't find a minimum value it needs, should the function print an error message with printf() or error(), throw exceptions, or do something else? I don't think there are hard rules here. You should probably deal with this on a case-by-case basis. > (d) For functions that generate plots, is there an example of a function that does this well? My question, how much should a package alter "look and feel" parameters like titles, axis labels, minor ticks, pointsize, etc.? Should I try to let users pass plot arguments through my function, or let them modify plots later? I don't know. If you want feedback on your work, feel free to contact me; I've been doing some manifold statistics for a while (directional statistics being a special-case). Søren |