-
-
Notifications
You must be signed in to change notification settings - Fork 732
Use standard format for Syntax, Parameters, and Returns sections #559
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 standard format for Syntax, Parameters, and Returns sections #559
Conversation
@robsoncouto Can you merge this, please? This would be a huge step towards consistency. |
Hi @SeppPenner. I'm favor of consistency. However, as this pull request changes so many reference files, I would prefer that someone from the Arduino team could review and accept it. |
@robsoncouto Ah okay. This might take some time, I guess... |
@SeppPenner, that is not the problem at all. Besides, per's contributions are generally well organized and a breeze to review. I just feel that this is an important step for the reference, heavily impacting all the other reference repos, and I do not have the authority for accepting it, even though I agree with the change. I believe this is per's opinion as well, please see #536. |
@robsoncouto I know, I have already talked to him somewhere else about this^^ |
I have faithfully followed the standard established by the reference sample. The exception is in documenting the return type, since the reference sample does not provide any guidance on this subject. In this, I attempted to be consistent with the standard established for documenting parameter types ("Allowed data types:" for parameters, "Data type:" for return type).
It's actually not my opinion. #536 is different from this PR in that it is changing the official policy, whereas this PR is only enforcing the existing official policy. There are two exceptions:
Just to be clear, I am a member of the Arduino team since this January. There's no indication of how long we might need to wait for someone else from Arduino to help out with this project. I'm a bit sad about this because I feel that the Language Reference is starting to get pretty polished but there are a couple more major projects that I was excited and motivated to do. The first is to specify parameter and return types for all functions (#15) (which is currently done only sporadically), and confirm that all existing type documentation is correct (it's not). This PR lays the groundwork for that project. The second is to review all the reference pages and correct all the typos I find. I already have a long list of typos I've run across during my work, but I want to fix them all comprehensively, rather than submitting a zillion individual PRs. These wide-ranging PRs that don't get merged are a burden on me because they get merge conflicts every time a minor PR is merged, and I must constantly be fixing these merge conflicts to keep the PR in a condition where it could be merged if that day ever comes. I feel that the lack of assistance from the Arduino team is an indication they don't feel this work is a high priority. Due to these factors, I've put any further major work on the Language Reference on hold until such time as the situation changes, even though I would very much like to continue with the project. |
I'm sorry, I got that wrong then.
When I asked you about this, you simply said that you were given write access to this repository. So I could not know, as I have access and I am not a member :) Anyways, thanks for your thoughts @SeppPenner and @per1234. Now that I know that per is a member of Arduino and responsible for this repository I don't see reason for holding this any longer. I will check everything and accept this as soon as possible. |
Sorry I didn't made my status more clear before now. I haven't felt like things are so much different now from my years of volunteer status, other than that I have a little more access and more time to dedicate to the project. I'm not yet used to being somewhat "official", whatever that means.
Thanks! Let me know if there's anything you want me to change, including the situation with the backticks on the type names. Also, I want to be clear that, although I very much want to see this be merged, I don't hold you to any obligation or expectation to work on this if you don't have the time or desire. I'm forever grateful for all the excellent work you've done so far on the Language Reference project and whatever whatever further work you might have time and energy for. |
|
||
[float] | ||
=== Returns | ||
`bool` | ||
Data type: `bool`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this could be replaced with:
true
if the target string was found,false
otherwise. Data type:bool
.
|
||
[float] | ||
=== Parameters | ||
`thisChar`: variable. *Allowed data types:* char | ||
`thisChar`: variable. Allowed data types: `char`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be improved as:
thisChar
: the character variable. Allowed data types:char
. ?
What do you think? Too verbose?
|
||
[float] | ||
=== Returns | ||
`bool` | ||
Data type: `bool`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the previous.
[float] | ||
=== Returns | ||
`float` | ||
Data type: `float`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is missing the function's return explanation.
|
||
[float] | ||
=== Returns | ||
`size_t`: `print()` returns the number of bytes written, though reading that number is optional. | ||
`print()` returns the number of bytes written, though reading that number is optional. Data type: `size_t`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that "print()
returns" could be removed here to make things uniform.
@@ -29,13 +29,13 @@ The random function generates pseudo-random numbers. | |||
|
|||
[float] | |||
=== Parameters | |||
`min` - lower bound of the random value, inclusive (optional) | |||
`min`: lower bound of the random value, inclusive (optional). + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing data types?
`numerator` : variable or constant. *Allowed data types:* int, float, double, byte, short, long + | ||
`denominator` : *non zero* variable or constant. *Allowed data types:* int, float, double, byte, short, long | ||
[%hardbreaks] | ||
`result`: variable. Allowed data types: `int`, `float`, `double`, `byte`, `short`, `long`. + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the previous.
`operand1` : variable or constant. *Allowed data types:* int, float, double, byte, short, long + | ||
`operand2` : variable or constant. *Allowed data types:* int, float, double, byte, short, long | ||
[%hardbreaks] | ||
`product`: variable. Allowed data types: `int`, `float`, `double`, `byte`, `short`, `long`. + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the previous.
`operand1` : variable or constant. *Allowed data types:* int, float, double, byte, short, long + | ||
`operand2` : variable or constant. *Allowed data types:* int, float, double, byte, short, long | ||
[%hardbreaks] | ||
`difference`: variable. Allowed data types: `int`, `float`, `double`, `byte`, `short`, `long`. + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the previous.
[float] | ||
=== Parameters | ||
`myString, myString2`: a variable of type String | ||
`myString, myString2`: a variable of type `String`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
myString, myString2
: variables of type String
.
or could be separated like you did above.
Hi @per1234. |
Thanks for all the great suggestions @robsoncouto! I agree with all of them and also that they are better for a separate PR. My goal with standardizing the format of these sections was to create a consistent framework to make it easier to implement just these sorts of changes. |
I have faithfully followed the standard established by the reference sample. The exception is in documenting the return type, since the reference sample does not provide any guidance on this subject. In this, I attempted to be consistent with the standard established for documenting parameter types ("Allowed data types:" for parameters, "Data type:" for return type).
Note that this PR only reformats the existing content regarding parameter and return types. Documenting all parameter and return types will be done in a separate PR.
Fixes #559