The COIN constant is critical in understanding Bitcoin's supply, but what it represents isn't clear from the name of the constant. Adding a comment clarifies the meaning of the constant for future readers.
doc: Add comment to COIN constant #23293
pull kennanmell wants to merge 1 commits into bitcoin:master from kennanmell:master changing 1 files +1 −0-
kennanmell commented at 8:58 PM on October 16, 2021: contributor
-
1946af2c45
Add comment to COIN constant.
The COIN constant is critical in understanding Bitcoin's supply, but what it represents isn't clear from the name of the constant. Adding a comment clarifies the meaning of the constant for future readers.
- DrahtBot added the label Consensus on Oct 16, 2021
- MarcoFalke renamed this:
consensus: Add comment to COIN constant.
doc: Add comment to COIN constant.
on Oct 17, 2021 - MarcoFalke removed the label Consensus on Oct 17, 2021
- MarcoFalke added the label Docs on Oct 17, 2021
-
katesalazar commented at 9:34 AM on October 17, 2021: contributor
NAK: The sat to coin ratio is already known to all code readers when they reach this line. What is needed here is not a redundant comment, but thousands separator at the programming language.
- lsilva01 approved
-
lsilva01 commented at 4:22 AM on October 18, 2021: contributor
ACK 1946af2 Documenting the purpose of a constant helps new developers to understand code.
- shaavan approved
-
shaavan commented at 12:00 PM on October 18, 2021: contributor
ACK 1946af2c45372e3de39000a45a5954bb5870bc1b
I agree with adding the comment, explaining the reason for a constant having a particular value. @KateSalazar I believe that the risk of this comment being redundant is far outweighed by the value it is adding to the single person, who might not be aware of why the constant COIN has this particular value.
-
laanwj commented at 12:26 PM on October 18, 2021: member
Concept ACK (no hurt in adding a comment)
The COIN constant is critical in understanding Bitcoin's supply
Interestingly, the only consensus-critical place it is used in is
GetBlockSubsidy. I sometimes wonder if it should be. There is no 'bitcoin' at the protocol level, after all. Apart from there, it's used as a unit for RPC and the GUI only. -
kennanmell commented at 4:48 AM on October 20, 2021: contributor
NAK: The sat to coin ratio is already known to all code readers when they reach this line. What is needed here is not a redundant comment, but thousands separator at the programming language.
Well, I can only say that I had to double check the ratio myself with a Google search when I came across this. If adding this comment lets a future reader avoid doing that then I'd say it's worth it.
- laanwj renamed this:
doc: Add comment to COIN constant.
doc: Add comment to COIN constant
on Oct 21, 2021 - laanwj merged this on Oct 21, 2021
- laanwj closed this on Oct 21, 2021
- sidhujag referenced this in commit 5ce3a10300 on Oct 21, 2021
- DrahtBot locked this on Oct 30, 2022