-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Remove CoreStringNames
and SceneStringNames
#50941
Conversation
c2b4615
to
aa2045a
Compare
24c8da6
to
9c25c68
Compare
I think part of the idea was to prevent bugs caused spelling errors in the strings... although the StringNames classes were not really used very diligently or consistently throughout the codebase. What about |
Didn't know about
From a quick search it seems |
9c25c68
to
721243d
Compare
CoreStringNames
as it's no longer usefulCoreStringNames
and SceneStringNames
Alright, I removed |
721243d
to
ea2f3f3
Compare
I think this may still make sense but would likely need to be redone. But we should discuss it a bit more beforehand to make sure we agree on what should be done. Back when this was discussed we also had some ideas to maybe use a macro that could define this kind of static StringName in the class with an actual C++ identifier so we avoid strings, but reduz wasn't fond of the idea IIRC. It's not urgent for 4.0, this can be done after the 4.0 release as a general code quality measure. |
Related: #80573 and #81303 While the gain is rather minimal, it's still better to use them in place of repeated SNAMEs and plain strings. Though unused singleton names and names used once should be removed, I plan to clean up that too. |
Superseded by #91909. |
See https://chat.godotengine.org/channel/scripting?msg=ZCRd86Xg7vAtDaNKu
Not certain that this is desired, but
CoreStringNames
andSceneStringNames
aren't used very consistently, several of theirStringName
s are unused, and they're no longer that useful for caching theStringName
s since we have theSNAME()
macro. I this will make it less work to implement something better like godotengine/godot-proposals#2152.