godot-xr-tools
godot-xr-tools copied to clipboard
Breaking name changes
Hi everyone,
I would like some input from others about something I've come to regret since starting this project and that is its naming conventions.
Most scripts/scenes start with a word identifying its group and then follow by a name that identifies its purpose. So we have Function_Direct_Movement
and Object_pickable
. Not really the best picks.
I want to do a pass and rename all these to more suitable names but obviously this would break existing uses of the plugin. I'll thus warrant a 2.0 release.
How do people feel about this as a change?
By renaming you mean removing the group and just keeping the verb (e.g. point
instead of Function_pointer
) or adjective (e.g. pickable
instead of Object_pickable
)?
That would be totally fine for me. Especially beacause these functions and objects are still grouped by folders.
If you're going to break compatibility, I would suggest renaming the signal name button_release
to button_released
to be consistent with the button_pressed
signal. It's used in function_pointer.gd and function_pickup.gd.
I'd be ok with a name change, so long as the new names are a clear improvement over the old ones.
@pwab indeed, and possibly changing the names to something more descriptive. I'm planning to do this as we're rewriting this for Godot 4.
I personally think that Object_pickable
should be changed to Object_interactable
.
Unfortunately the code-base seems to have a few different standards for component names (and alas I'm guilty of a few of them). The following is the current list:
-
XRTools"CamelCaseName" naming convention:
- XRToolsHand
- XRToolsHandPhysicsBone
- XRToolsPhysicsHand
- XRToolsInteractableArea
- XRToolsInteractableBody
- XRToolsMoveTo
- XRToolsPickable
-
XRT"CamelCaseName" naming convention:
- XRTHighlightMaterial
- XRTHighlightRing
- XRTHighlightVisible
- XRTSnapZone
-
Function_"CamelCaseName" naming convention:
- Function_FallDamage
- Function_ClimbMovement
- Function_CrouchMovement
- Function_DirectMovement
- Function_FlightMovement
- Function_Glide
- Function_Grapple
- Function_JumpDetect
- Function_Jump
- Function_Pickup
- Function_TurnMovement
- Function_WindMovement
-
No identifiable naming convention:
- PlayerBody
- MovementProvider
- ARVRHelpers
- VelocityAverager
- VelocityAveragerLinear
- VirtualKeyboard2D
- Object_climbable
- WindArea
- GroundPhysics
- GroundPhysicsSettings
I'm a fan of XRTools<CamelCaseName> to minimize the possibility of name collisions with classes in any other libraries. This would also make it easier to find nodes in the "Create New Node" wizard.