document spork system with doxygen comments#2301
Conversation
gladcow
left a comment
There was a problem hiding this comment.
May be it is better to place method descriptions in header file and to place only some implementation-specific notes in cpp file?
There was a problem hiding this comment.
"representations" should be singular
Thanks for the suggestion. I added them with the implementations because I thought that made more sense, but maybe the actual C++ way is to add them in the header files. Since the classes were declared in header files, that's where I added those class comments. Technically the methods are "declared" in the class definition (e.g. the function prototypes). I guess the big questions (for me) are:
|
Doesn't seem like there is one that I can find. Found this that makes sense (just some guys opinion):
|
There is no common convention for comments, but there is google styleguide, for example, https://google.github.io/styleguide/cppguide.html#Function_Comments or such guide: http://www.edparrish.net/common/cppdoc.html. The most common practice is describe function goal and usage conditions in header and non-obvious implementation details in cpp file, I think.
Function description in header is more helpful: when you see unknown function in code, you are clicking |
|
@gladcow The more I look over DashCore code, I'm realizing that I don't actually look in the header files. And in my IDE when I click to go to the function, it's taking me to the implementation (e.g. the cpp file), not the header declaration (I use CLion). Personally I don't think it makes since to stick the documentation in the header files where I'm not even looking at the file. The comments make the most sense to me where the method is defined (not declared). |
|
@PastaPastaPasta I'm almost certain your random guy's opinion came from StackExchange, which I also found yesterday as well, while searching conventions. I also found others which differ, also on Stack Exchange, such as this one (which I tend to agree with):
|
|
Rebased onto |
There was a problem hiding this comment.
The signature field is not included in the serialization. this will not be true after #2288
There was a problem hiding this comment.
I'm not sure why
The signature field is not included in the serialization. - that's why in this case ;)
There was a problem hiding this comment.
Should probably clarify that this is only true for time-based sporks (which are majority), for pure value-based sporks like SPORK_5_INSTANTSEND_MAX_VALUE this function makes no sense and should not be used.
|
Fixed |
This is an initial shot at an on-going WIP, which will add documentation via Doxygen comments to (especially) Dash-specific features in the codebase.
|
Added comments for new methods introduced in #2288, squashed & rebased to resolve conflicts. Please re-review. |
This is an initial shot at an on-going WIP, which will add documentation via Doxygen comments to (especially) Dash-specific features in the codebase.
This is an initial shot at an on-going WIP, which will add documentation via Doxygen comments to (especially) Dash-specific features in the codebase.
@UdjinM6 I will need some guidance on the rationale for
GetSignatureHash, as you will see. 😉