MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

vNext Proposal: Change public enum suffix.

Open Railboy opened this issue 8 years ago • 9 comments

Does this affect the legacy HoloToolkit (master) or the Mixed Reality Toolkit (mrtk_release)? Mixed Reality Toolkit

Is your feature request related to a problem? Please describe. The current naming convention for public enums (suffix Type) should change. Not everything an enum enumerates can or should be considered a 'type.' For instance:

 AppModeEnum.Initializing
 SessionStateEnum.InProgress

becomes:

AppModeType.Initializing
SessionStateType.InProgress

These are clumsy and redundant. A 'type' of mode or a type of state is just a mode or state.

Describe the solution you'd like I'd love to eliminate the suffix for enums altogether, but Enum works. It's content-neutral and it helps discoverability.

Since this would be a breaking change it's something we'd want to do before vNext exits beta.

Railboy avatar Oct 31 '18 17:10 Railboy

I figured now would be an ideal time to re-open the subject since we don't have a lot else on our plate.

Railboy avatar Oct 31 '18 23:10 Railboy

Agreed "Type" is already the enum suffix as per the standards guide. It was originally "Enum" and it was changed by majority discussion, so I don't feel we should revisit this again.

The style guide is one of the hotly debated items over the lifetime of the project @Railboy

SimonDarksideJ avatar Nov 01 '18 08:11 SimonDarksideJ

The style guide is one of the hotly debated items over the lifetime of the project @Railboy

@SimonDarksideJ And continues to be, evidently.

Kidding about workload aside, if this bothers no one else we can shelve it until style guide discussions are inevitably re-opened to the greater community post-release.

Railboy avatar Nov 01 '18 17:11 Railboy

Most of the agreement around the "Type" suffix was a lot of "I'm ok either way, I guess Type works fine." I was among those answers.

However this example compels me to change my opinion to "Yeah, Enum is better, but it's not a big deal":

AppModeType.Initializing SessionStateType.InProgress

Maybe we should remove the enum guidance from the style guide and leave it to individual judgement? It almost seems like the value of the enum guidance is less than the maintenance of debating the enum guidance.

Ecnassianer avatar Nov 01 '18 18:11 Ecnassianer

It doesn't matter to me much, shoot let's just loose it altogether! 🙃 Haha, jk. I think the fact that we have a suffix actually serves a functional purpose when it comes to declaring names of fields and properties in the class based off the enum type.

StephenHodgson avatar Nov 01 '18 18:11 StephenHodgson

Breaking change, we should review next shiproom to make a decision with the group

Yoyozilla avatar Jan 11 '19 20:01 Yoyozilla

@StephenHodgson Seriously though, lets drop the whole suffix. 'Enum' especially is banned by the standard .Net naming conventions here: https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations

jwittner avatar Jan 16 '19 19:01 jwittner

Changing to NO suffix :)

david-c-kline avatar Jan 16 '19 19:01 david-c-kline