Mathematica has a lot of very useful undocumented features. For example a hash table, a built-in list of compilable functions, additional options to CurrentValue, {"Raw", n}
histogram bin specification, etc...
A natural question that arises is: Why is this functionality undocumented? Is it because the feature is under development? Or because the syntax has not been finalized and may be changed? Something else?
Also: Is using this functionality safe in the sense that it will not cause problems when a new version is released?
Answer
The two main arguments against using undocumented functions are:
- Your code might not work as expected in future versions;
- Your code might not work as you intended in the current version, because you only have a partial understanding of a function or option that is undocumented.
In the case of Mathematica, though, there is no guarantee that even documented functions will remain unchanged in future versions.
The two main arguments for using undocumented functions are:
- Oftentimes they presage the permanent inclusion of that functionality in a future version. For example,
ScalingFunctions
is only documented for charting functions likeBarChart
, but it has been shown to work also forListPlot
andPlot
(but notDateListPlot
). I predict that they will get around to completing (and documenting) this functionality in a future version. (EDIT: In fact, that's exactly what happened in 10.4, even though the online version of the documentation doesn't make it clear that this is new.) - The functionality might be documented, but not completely documented. For example, some option values (say
PlotRegion
) are documented as applying to "graphics functions", without specifying which ones. So the functionality is there, and might well remain stable for several versions.
Mathematica is a complex system with an enormous array of possibilities for the use and abuse of its rich functionality. Even with the massive documentation that exists, there are bound to be some undocumented or incompletely documented functions. Undocumented functions (and options) need to used with some care, but given the usefulness of some of the functionality they offer, it might well be worth the risk.
Comments
Post a Comment