mongodb/mongo-c-driver — pull request #30 by bspaeth (2012-03-17 06:04:42+00:00)
Title: design proposal: return empty string if none of the "string-string" types applies in bson_iterator_string

Apparently this would have better been placed in a forum, mailing-list or anything alike. As I was too dumb to find any opportunity like this if it exists, I decided to place it here.

As it seems regarding bson_iterators the bson API offers accessor functions in two variations.
* those potentially returning garbage on the attempt to acces a values of inapropriate type,
recognizable by a trailing _raw appended as suffix.
bson_iterator_bool_raw, bson_iterator_int_raw, ... and the like

* secondly something like "safe" functions returning at least some kind of usable value,
labeled without any suffix like the one mentioned before:
bson_iterator_raw, bson_interator_int, .... to name just a few.

I'm quite conscious about the fact, that it is just a matter of taste, but at least in my opinion it could add to the felt consistency of the API if bson_iterator_string would conform to the naming pattern used in the other accessor functions.