Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Suggest renaming cn_cbor_index to cn_cbor_array_index #35

Open
jimsch opened this issue Aug 26, 2015 · 2 comments
Open

Suggest renaming cn_cbor_index to cn_cbor_array_index #35

jimsch opened this issue Aug 26, 2015 · 2 comments

Comments

@jimsch
Copy link
Contributor

jimsch commented Aug 26, 2015

Having the word array in the function name would make it clear that this is what it is used for. Trying to remember the name without that help is harder given that a search for array does not find it. Note that all of the map functions have map in them. i.e. cn_cbor_mapget_int.

For complete consistency with maps it really out to be cn_cbor_arrayget_index, but that seems not to be correct.

@hildjj
Copy link
Contributor

hildjj commented Aug 26, 2015

+1 for a rename, but i'd suggest that we redo them all at the same time. I suggest: namespace_class_operation. The namespace is currently "cn_cbor", the class is "array" or "map", and the operations could be string_get, int_set, and append. We could shorten the namespace to "cnc" if we wanted slightly shorter names. This would give:

  • cnc_map_int_get, cnc_map_string_get (get_string sounds like we're returning a string to me)
  • cnc_array_int_get

Anything we do here is a breaking API change, so we may as well fix everything at once and rev the major version number.

@jimsch
Copy link
Contributor Author

jimsch commented Aug 27, 2015

Yes, I actually ended up writing what would be cnc_array_int_set because it was going to be easier for me to do work where position in the array was important as well.

you can see the source https://github.com/jimsch/COSE-C/blob/master/src/cbor.c

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants