-
-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
Rename type_string
to type_to_string
#97183
Conversation
…nd consistency with naming conventions in the Godot Engine.
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.
Thank you for your contribution
This can't be done without major compatibility breakage, there's no way to register compatibility methods for these methods, which makes this not possible to handle gracefully
Renaming this serves little purpose, and breaks all existing code using it
The way to solve this would be to deprecate the old method and add a new one, if that is done this can move forward to be discussed
Have you discussed this need with anyone? Is this a problem people have raised on the forums or elsewhere? What is behind this change? |
I understand the compatibility concerns. My goal was to improve clarity since type_string can be confusing alongside TYPE_STRING from Variant.Type. |
I'd say that confusion is minimal, and changing it would make it follow naming in general worse, considering |
I apologise if I make any mistakes as this is my first time contributing to the Engine and I'm not accustomed to this procedure yet. |
It's okay it's a learning experience! I think opening a proposal to gauge what people think would be a good step, if you're still interested in working on this To make the necessary changes you would need to add |
If major compatibility breakage is the main issue this can wait til the next Major revision where backwards compability isnt much of an issue as far as im aware. |
That would be best I think, feel free to open a proposal to discuss things in the meantime |
Okay i might try this and see how it goes, thanks for the advice! It really helps. |
…kward compatibility as well as updated docs to reflect this.
Not exactly sure if i did this right but i tried atleast! |
Co-authored-by: A Thousand Ships <[email protected]>
Co-authored-by: A Thousand Ships <[email protected]>
Co-authored-by: A Thousand Ships <[email protected]>
type_string
to type_to_string
type_string
to type_to_string
Looks like all the checks have passed 👍🏼 |
I think currently it's adding more bloat for a minimal (and debatable) improvement, hence I'm rather against such rename (in 4.x).
Note there's also |
I appreciate the feedback, but the goal here is to improve clarity, not bloat the code. The change is extremely minimal and aimed at making the method name more intuitive. I havent mentioned anything about "error_string" so it’s not relevant to the discussion. |
To add to this the |
The bloat here is the deprecation
I brought it up before and the PR itself talks about "consistency with naming conventions in the Godot Engine" but |
That's obvious / I wouldn't assume anyone's intention is to bloat the code. 🙃 But as a result of this PR for now (in 4.x) we would have two methods:
The change being extremely minimal is the problematic part to me. If the name would be completely wrong then renaming/fixing it would make sense. But only slightly tweaking the name to prevent potential minimal confusion I'd say is not enough of a justification.
It's absolutely relevant. If talking about naming consistency then already existing names should be taken into account. And because Currently:
With this PR (in its current form):
To clarify: I'm not suggesting to add |
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.
Requires a squash before merging.
To clarify the PR workflow - a squash before merging would indeed be needed, but this PR hasn't been approved for merging by maintainers yet. So I wouldn't request more work from @sirjoehighton when there are high chances that this PR may be rejected - as there's no proposal/explicit demand to back this up and two maintainers (@AThousandShips and @kleonc) already expressed that this may not be a good idea to do this change now. |
Now as a maintainer review, I confirm what AThousandShip and kleonc already said, I don't think this is a good change at this stage. It adds unnecessary duplicates in the API, which makes the API IMO more confusing that the issue that the issue that this aims to address. I'm also not convinced the "problem" is really one. I do see at least one user was confused by the API (at least I assume so if you propose to change it), but I don't see evidence that it's a widespread problem. I think such a change would only make sense to do for a hypothetical Godot 5.0, but it's not planned currently, so I would prefer to simply not consider it. Even for Godot 5.0, I'm not sure we should still do "arbitrary" renames to make things slightly clearer like this, which in the 3.x to 4.0 transition were done quite a lot and seemed to upset a number of users having to deal with conversions that weren't a clear win in their eyes. Thanks for the contribution nonetheless! |
Belatedly, I'd like to add that in the future we should consider adding the ability to get enumerator names for all enums (global, native, custom).
EDIT: These two functions do not return the enumerator name, but return the type name and a human-readable error string respectively. So we should not deprecate them. |
Renamed method
type_string
totype_to_string
for better clarity and consistency with naming conventions in the Godot Engine. As well as altering the documentation to reflect this change in all supported languages.