-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use id
instead of index
#30
Comments
In the case of this module I've mostly followed the prior art at https://github.com/mafintosh/flat-tree. I see where you're coming from, but mostly for compat reasons I reckon it might be best to keep things similar. I personally don't care too much about naming in this case, but probably the easiest approach in case of doubt is to keep things similar so bridging between the two is as straight forward as possible. Hope that makes sense! |
Yes, the terminology should be in sync, so I opened the same issue in that repo too: mafintosh/flat-tree#12 I assume there is no other reason against the rename. |
I've provided an answer here: mafintosh/flat-tree#12 (comment) |
It seems to me that the data referred to as
index
is not really an index. At least it's not the node index when building the merkle-tree. It's a bit confusing when the nodes are stored in a flat data structure (e.g., a list).When building the merkle-tree, there is an inherent ordering which is the order in which each hash is computed (using this order requires the least amount of memory to build the merkle-tree):
...
The
index
for the above hashes in the flat-tree are the following:Maybe there is a reason for using
index
to refer to these nodes, but I could not find one. So, if there is no specific reason for this name, I propose to useid
or maybeposition
instead.The text was updated successfully, but these errors were encountered: