Bevy ECS naming convention #2742
afonsolage
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I know this topic has been discussed before o Discord, but I think it's a good idea to also keep it on GitHub Discussions. Also I would like to address a more general discussion about bevy naming convention.
First of all, the idea isn't to force users or core/members devs to use this naming convention, but instead give some guidance nor share some personal preferences to newcomers.
Also bevy is in too early stage to have a
style guide
or something like that, so that's not the point here.That being said, most things created by users is either
struct
/enum
orfunction
, where each one can be:struct
/enum
function
After reading some examples and users projects I noticed that some folks (don't know how often, tho) use some conventions:
Event
suffix for eventsState
suffix for states_system
suffix for system functionssetup_
orbuild_
prefix for startup functionsI would like to hear any thoughts or experience about using naming conventions, what have you folks been using and think what works and what doesn't works.
For me, I'm willing to use:
Position
,Health
)Res
suffix (ScoreRes
,TextureRes
)Event
suffix (WinEvent
,HitEvent
)State
suffix (GameState
,ManuState
)SystemLabel
-Label
suffix (LoadLabel
,PipelineStepLabel
)_system
suffix (navigate_system
,player_move_system
)setup_
prefix (setup_textures
,setup_score
)is_
/can_
/should_
/has_
something like bool variable naming convention (is_under_water
,can_build
)Beta Was this translation helpful? Give feedback.
All reactions