-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
c_sharp_exports.rst: fix private naming style; minor grammar #8853
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
Conversation
|
I think these should be public instead as they're exported CC @raulsntos |
|
We use private exported fields in a lot of places, and we explicitly discourage using public fields in the style guide. |
|
Where? The styleguide makes no mention of exports, and the exports page uses public almost all the time The official demo projects also do not use private fields exclusively A search of the documentation itself shows:
A search of the demo projects shows:
|
Didn’t say the styleguide mentioned exports, it mentions preferring properties to non public fields. And yes, the docs also show a lot of exported public properties. Which is why I’m saying if this is intended to be shown as public, it should be a property, else it should stay private. And if it is shown as a property, we essentially have a page about exports that lacks any example using fields which is… misleading IMHO. Then again, only trying to help. |
|
Gotcha, did mean public and fields, not necessarily public plain variables 🙂 sorry for being unclear |
Personally, I agree. However, many people I've talked with (e.g. on the C# help discord channel) are accustomed to C# serialization libraries that readily get and set I think it's important for this doc to point out that fields and properties, public and private, all work, so nobody thinks Godot is "forcing" them to do something they feel is unnatural--regardless of Godot or broader industry style. That said, making all but the first few examples default to |
raulsntos
left a comment
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.
Making them public makes sense to me. As long as, like you said, it's clear that it's also possible to export fields, and that the access modifier doesn't matter.
I think, with the current changes, it's clear enough.
0a85ca4 to
b3b15a6
Compare
|
Thank you! Merged. 🎉 |
I took a peek at this doc for reference for #8815 (comment) and saw that
private Foo _foostyle wasn't being used consistently here. Also a couple minor grammar changes.