4 ms·
> I sometimes encounter libraries which provide weird options or methods for which I never understand their purpose. I won't name and shame the author because
by Sean1708 8y ago
> I sometimes encounter libraries which provide weird options or methods for which I never understand their purpose.
I won't name and shame the author because it's just a little personal project, but my favourite example of this is the following bit of documentation:
get :: JSON → JSON → JSON
Get the value at k from the object
While I can use common sense to guess at the order, I have absolutely no idea how you're supposed to index JSON with JSON.
- Arnavion 8y agoProbably the index can be either a JSON number (for indexing arrays) or a string (for indexing objects), so it takes JSON to support both. Maybe the library also allows you to index with other JSON values and stringifies them internally, reducing them to the string case.
- voltagex_ 8y agoSubmit a bug report - treat documentation like code in that sense. You're probably not the only one confused by this.