You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd suggest CompassDirection over Direction8, as it is more explicit about the contents of the enum class. Direction8 provides no context to the fact that the enum class only holds horizontal directions.
There is no good word to imply all 8 cardinal and ordinal directions, I think "compass" is as close as you can get. It's not hard to just look at the class and see what constants are defined, nor is it a stretch to think that a compass direction enum would include ordinal directions.
These two classes shouldn't share much in common with their names. The EnumFacing type includes vertical directions while EnumDirection8 does not, but more generally, the behavior they offer is completely different, therefore warranting differentiation between them beyond the abstract concept of "direction". The referral to EnumFacing as Direction is reasonable given those are general directions with vector functionality, while for EnumDirection8, I propose CompassPoint.
Wiktionary has an article for compass point, but not for compass direction. But, I feel direction is a bit more obvious... so, no strong opinion between the two.
Activity
ChloeDawn commentedon Sep 2, 2018
I'd suggest
CompassDirectionoverDirection8, as it is more explicit about the contents of the enum class.Direction8provides no context to the fact that the enum class only holds horizontal directions.williewillus commentedon Sep 2, 2018
but
Compassdoesn't imply 8 either, for all I know it could just be the 4 cardinal directionstterrag1098 commentedon Sep 2, 2018
There is no good word to imply all 8 cardinal and ordinal directions, I think "compass" is as close as you can get. It's not hard to just look at the class and see what constants are defined, nor is it a stretch to think that a compass direction enum would include ordinal directions.
pau101 commentedon Sep 2, 2018
These two classes shouldn't share much in common with their names. The
EnumFacingtype includes vertical directions whileEnumDirection8does not, but more generally, the behavior they offer is completely different, therefore warranting differentiation between them beyond the abstract concept of "direction". The referral toEnumFacingasDirectionis reasonable given those are general directions with vector functionality, while forEnumDirection8, I proposeCompassPoint.williewillus commentedon Sep 3, 2018
hmm, I'd almost say I prefer
CompassDirectionoverCompassPoint, Direction is more accurate than Point imo (I'd have to see usages though)Pokechu22 commentedon Sep 3, 2018
Wiktionary has an article for compass point, but not for compass direction. But, I feel direction is a bit more obvious... so, no strong opinion between the two.
EDIT: all pages starting with
compass, for reference.pau101 commentedon Sep 3, 2018
@williewillus "Point" is used explicitly for the avoidance of "Direction", as comment argued.